Update public layout logic

This commit is contained in:
chuzhixin 2020-10-28 09:49:04 +08:00
parent 96de07d09a
commit cb41ab4f8a
3 changed files with 6 additions and 7 deletions

View File

@ -92,11 +92,10 @@
},
watch: {
$route: {
handler({ fullPath, matched }) {
//
if (fullPath === '/index') fullPath = '/'
if (fullPath === '/test/test') fullPath = '/test'
this.selectedKeys = [fullPath]
handler({ path, matched }) {
matched[0].children.length > 1
? (this.selectedKeys = [path])
: (this.selectedKeys = [matched[0].path])
this.openKeys = [matched[0].path]
},
immediate: true,

View File

@ -1,5 +1,5 @@
<template>
<a-menu-item :key="routeChildren.fullPath" @click="handleLink">
<a-menu-item :key="routeChildren.path" @click="handleLink">
<span class="anticon">
<vab-icon :icon="routeChildren.meta.icon"></vab-icon>
</span>

View File

@ -8,7 +8,7 @@
<template v-if="item.children && item.children.length">
<vab-menu
v-for="route in item.children"
:key="route.fullPath"
:key="route.path"
:item="route"
></vab-menu>
</template>