调整样式

This commit is contained in:
aixianling
2023-05-25 15:06:40 +08:00
parent 5f8850dc00
commit ad8f554ba2
2 changed files with 16 additions and 9 deletions

View File

@@ -1,9 +1,9 @@
<template>
<section class="AiTreePath">
<AiTreePath v-if="parent" v-bind="$props" :current="parent" v-on="$listeners"/>
<div v-else v-text="`全部`" @click="$emit('click','all')"/>
<AiTreePath v-if="parent" v-bind="$props" :node="parent" v-on="$listeners"/>
<b v-else v-text="`全部`" @click="$emit('click','all')"/>
<u-icon v-if="label" name="arrow-right" size="32" color="#ccc"/>
<div v-text="label" @click="$emit('click',current)"/>
<div :class="{active}" v-text="label" @click="$emit('click',node)"/>
</section>
</template>
<script>
@@ -12,7 +12,8 @@ export default {
props: {
current: {default: null},
prop: {default: () => ({})},
paths: {default: () => []}
paths: {default: () => []},
node: {default: null}
},
computed: {
options: v => ({
@@ -21,8 +22,9 @@ export default {
parent: 'parentId',
...v.prop
}),
label: v => v.current?.[v.options.label] || "",
parent: v => v.paths?.[v.current?.[v.options.parent]]
label: v => v.node?.[v.options.label] || "",
parent: v => v.paths?.[v.node?.[v.options.parent]],
active: v => v.node?.[v.options.id] == v.current
}
}
</script>
@@ -34,5 +36,10 @@ export default {
font-size: 36px;
line-height: 40px;
font-family: PingFang-SC;
.active {
font-weight: bold;
color: #26f
}
}
</style>