mirror of
https://github.com/misitebao/wails-template-vue
synced 2025-05-11 01:28:02 +08:00
- Optimized Javascript templates - Optimized Typescript templates - Migrated vue-i18n of templates to composition-api
34 lines
672 B
Vue
34 lines
672 B
Vue
<template>
|
||
<span class="openlink" @click="onClickhandle">
|
||
<slot></slot>
|
||
</span>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
name: "OpenLink",
|
||
props: {
|
||
href: String,
|
||
},
|
||
setup(props) {
|
||
const onClickhandle = () => {
|
||
// You cannot use the a tag directly, you need to call the Go method here to open the link using the default browser.
|
||
// 不能直接使用a标签,需要在这里调用Go方法以使用默认浏览器打开链接。
|
||
|
||
window.runtime.BrowserOpenURL(props.href);
|
||
};
|
||
|
||
return {
|
||
onClickhandle,
|
||
};
|
||
},
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
.openlink {
|
||
cursor: pointer;
|
||
text-decoration: underline;
|
||
}
|
||
</style>
|