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" v-for="route in permission_routes"
:key="route.path" :key="route.path"
:item="route" :item="route"
:base-path="route.path"
/> />
</el-menu> </el-menu>
<HeaderToolRight/> <HeaderToolRight/>

View File

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

View File

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