mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-06 03:58:00 +08:00
✅Update public layout logic
This commit is contained in:
parent
96de07d09a
commit
cb41ab4f8a
@ -92,11 +92,10 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: {
|
$route: {
|
||||||
handler({ fullPath, matched }) {
|
handler({ path, matched }) {
|
||||||
//暂未研究清楚此处,待改进
|
matched[0].children.length > 1
|
||||||
if (fullPath === '/index') fullPath = '/'
|
? (this.selectedKeys = [path])
|
||||||
if (fullPath === '/test/test') fullPath = '/test'
|
: (this.selectedKeys = [matched[0].path])
|
||||||
this.selectedKeys = [fullPath]
|
|
||||||
this.openKeys = [matched[0].path]
|
this.openKeys = [matched[0].path]
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-menu-item :key="routeChildren.fullPath" @click="handleLink">
|
<a-menu-item :key="routeChildren.path" @click="handleLink">
|
||||||
<span class="anticon">
|
<span class="anticon">
|
||||||
<vab-icon :icon="routeChildren.meta.icon"></vab-icon>
|
<vab-icon :icon="routeChildren.meta.icon"></vab-icon>
|
||||||
</span>
|
</span>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<template v-if="item.children && item.children.length">
|
<template v-if="item.children && item.children.length">
|
||||||
<vab-menu
|
<vab-menu
|
||||||
v-for="route in item.children"
|
v-for="route in item.children"
|
||||||
:key="route.fullPath"
|
:key="route.path"
|
||||||
:item="route"
|
:item="route"
|
||||||
></vab-menu>
|
></vab-menu>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user