This commit is contained in:
parent
0563748bf6
commit
e7459bc460
|
|
@ -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/>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue