mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-05-01 06:39:01 +08:00
fix: 面包屑过滤
This commit is contained in:
parent
44d962c2ff
commit
fc6df74d9e
@ -12,13 +12,16 @@
|
|||||||
{{ route.meta.title }}
|
{{ route.meta.title }}
|
||||||
</n-breadcrumb-item>
|
</n-breadcrumb-item>
|
||||||
<n-breadcrumb-item
|
<n-breadcrumb-item
|
||||||
v-for="item of breadItems"
|
v-for="(item, index) of breadItems"
|
||||||
v-else
|
v-else
|
||||||
:key="item.code"
|
:key="item.code"
|
||||||
:clickable="!!item.path"
|
:clickable="!!item.path"
|
||||||
@click="handleItemClick(item)"
|
@click="handleItemClick(item)"
|
||||||
>
|
>
|
||||||
<n-dropdown :options="getDropOptions(item.children)" @select="handleDropSelect">
|
<n-dropdown
|
||||||
|
:options="index < breadItems.length - 1 ? getDropOptions(item.children) : []"
|
||||||
|
@select="handleDropSelect"
|
||||||
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<i :class="item.icon" class="mr-8" />
|
<i :class="item.icon" class="mr-8" />
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
@ -65,11 +68,13 @@ function handleItemClick(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDropOptions(list = []) {
|
function getDropOptions(list = []) {
|
||||||
return list.map((child) => ({
|
return list
|
||||||
label: child.name,
|
.filter((item) => item.show)
|
||||||
key: child.code,
|
.map((child) => ({
|
||||||
icon: () => h('i', { class: child.icon }),
|
label: child.name,
|
||||||
}))
|
key: child.code,
|
||||||
|
icon: () => h('i', { class: child.icon }),
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDropSelect(code) {
|
function handleDropSelect(code) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user