mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-05-03 12:56:34 +08:00
✨修复左侧布局无法展开的bug
This commit is contained in:
parent
d5e038d91f
commit
f00b4a47fe
@ -19,6 +19,7 @@
|
|||||||
theme="dark"
|
theme="dark"
|
||||||
mode="inline"
|
mode="inline"
|
||||||
v-model:selectedKeys="selectedKeys"
|
v-model:selectedKeys="selectedKeys"
|
||||||
|
v-model:openKeys="openKeys"
|
||||||
>
|
>
|
||||||
<vab-menu v-for="route in routes" :key="route.path" :item="route" />
|
<vab-menu v-for="route in routes" :key="route.path" :item="route" />
|
||||||
</a-menu>
|
</a-menu>
|
||||||
@ -72,7 +73,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedKeys: ['/index'],
|
selectedKeys: [],
|
||||||
|
openKeys: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -90,11 +92,12 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: {
|
$route: {
|
||||||
handler({ fullPath }) {
|
handler({ fullPath, matched }) {
|
||||||
//暂未研究清楚此处,待改进
|
//暂未研究清楚此处,待改进
|
||||||
if (fullPath === '/index') fullPath = '/'
|
if (fullPath === '/index') fullPath = '/'
|
||||||
if (fullPath === '/test/test') fullPath = '/test'
|
if (fullPath === '/test/test') fullPath = '/test'
|
||||||
this.selectedKeys = [fullPath]
|
this.selectedKeys = [fullPath]
|
||||||
|
this.openKeys = [matched[0].path]
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user