This commit is contained in:
yuanzbz 2023-05-28 22:12:29 +08:00
parent 0563748bf6
commit e7459bc460
3 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,7 @@
v-for="route in permission_routes"
:key="route.path"
:item="route"
:base-path="route.path"
/>
</el-menu>
<HeaderToolRight/>

View File

@ -15,7 +15,7 @@
v-for="route in permission_routes"
:key="route.path"
:item="route"
:base-path="route.path"
/>
</el-menu>
</el-scrollbar>

View File

@ -1,8 +1,8 @@
<template>
<template v-if="!item.hidden">
<template v-if="!item.alwaysShow && hasOneShowingChild(item.children, item)">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)">
<app-link v-if="onlyOneChild.meta" :to="onlyOneChild.path">
<el-menu-item :index="onlyOneChild.path">
<el-icon :size="20">
<component :is="onlyOneChild?.meta.icon"></component>
</el-icon>
@ -10,7 +10,7 @@
</el-menu-item>
</app-link>
</template>
<el-sub-menu :index="resolvePath(item.path)" v-else popper-append-to-body>
<el-sub-menu :index="item.path" v-else popper-append-to-body>
<template #title>
<el-icon :size="20"> <component :is="item.meta?.icon"></component></el-icon>
<span>{{ item.meta && item.meta.title }}</span>
@ -19,7 +19,7 @@
v-for="child in item.children"
:key="child.path"
:item="child"
:base-path="resolvePath(child.path)"
/>
</el-sub-menu>
</template>
@ -60,7 +60,7 @@ const hasOneShowingChild = (children = [], parent) => {
}
//
if (showingChildren.length === 0) {
onlyOneChild.value = { ...parent, path: '', noShowingChildren: true }
onlyOneChild.value = { ...parent, noShowingChildren: true }
return true
}