Skip to content

Commit

Permalink
my-link增加是否加粗配置
Browse files Browse the repository at this point in the history
  • Loading branch information
zhontai committed Dec 10, 2024
1 parent 92365bd commit 4042c3f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/zhontai.ui.admin.vue3/src/components/my-link/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<el-link type="primary" :underline="false" :href="href" @click.prevent.stop="onToPage()">
<el-link :class="{ 'my-link--bold': bold }" type="primary" :underline="false" :href="href" @click.prevent.stop="onToPage()">
<slot> </slot>
</el-link>
</template>
Expand All @@ -11,6 +11,8 @@ import { useRouter } from 'vue-router'
const router = useRouter()
const model = defineModel({ type: Object })
const bold = defineModel('bold', { type: Boolean, default: false })
const href = computed(() => {
const { href } = router.resolve({
path: model.value.path,
Expand All @@ -28,4 +30,8 @@ const onToPage = () => {
}
</script>

<style scoped lang="scss"></style>
<style scoped lang="scss">
.my-link--bold {
font-weight: 600;
}
</style>

0 comments on commit 4042c3f

Please sign in to comment.