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

37 lines
821 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方法以使用默认浏览器打开链接。
console.log(i18n.global.t("global.click-link") + props.href)
2021-09-09 12:08:24 +08:00
alert(i18n.global.t("global.click-link") + props.href + '\n\n' + i18n.global.t("global.not-supported"))
2021-09-09 05:16:10 +08:00
}
return {
onClickhandle
}
}
};
</script>
<style lang="stylus">
.openlink{
cursor pointer
text-decoration underline
}
</style>