wails-template-vue/frontend/src/components/public/OpenLink.vue

37 lines
696 B
Vue
Raw Normal View History

2021-09-09 05:16:10 +08:00
<template>
<span class="openlink" @click="onClickhandle">
<slot></slot>
</span>
</template>
<script>
import i18n from "@/i18n";
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方法以使用默认浏览器打开链接。
2021-09-13 20:44:29 +08:00
window.runtime.BrowserOpenURL(props.href)
2021-09-09 05:16:10 +08:00
}
return {
onClickhandle
}
}
};
</script>
<style lang="scss">
.openlink {
cursor: pointer;
text-decoration: underline;
2021-09-09 05:16:10 +08:00
}
</style>