wails-template-vue/frontend/packages/javascript/src/components/public/OpenLink.vue
misitebao b0233f3f8a feat: optimizing typescript templates and internationalization
- Optimized Javascript templates
- Optimized Typescript templates
- Migrated vue-i18n of templates to composition-api
2022-03-24 09:59:48 +08:00

34 lines
672 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>