feat: text组件增加点击链接弹框

This commit is contained in:
wuyuting1
2022-09-20 17:51:41 +08:00
parent 369a8ade42
commit 31c63130d6
3 changed files with 26 additions and 2 deletions
@@ -15,7 +15,10 @@
background-color:${backgroundColor}`"
>
{{ option.dataset }}
<n-button v-if="link" @click="click" text>
{{ dataset }}
</n-button>
<span v-else>{{ dataset }}</span>
</div>
</div>
</template>
@@ -35,6 +38,7 @@ const props = defineProps({
const { w, h } = toRefs(props.chartConfig.attr)
const {
link,
dataset,
fontColor,
fontSize,
@@ -68,6 +72,11 @@ watch(
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => {
option.dataset = newData
})
//打开链接
const click = () => {
window.open(link.value)
}
</script>
<style lang="scss" scoped>