|
@@ -107,6 +107,14 @@
|
|
|
},
|
|
|
openActiveItemMenus() {
|
|
|
let index = this.activeIndex;
|
|
|
+ // 选中用户指定的路由对应的menu
|
|
|
+ if (this.router) {
|
|
|
+ const userSpecifiedIndexs = Object
|
|
|
+ .keys(this.menuItems)
|
|
|
+ .filter(k => this.menuItems[k].route)
|
|
|
+ .filter(k => this.menuItems[k].route.path === this.$route.path);
|
|
|
+ userSpecifiedIndexs.length && (index = this.activeIndex = userSpecifiedIndexs[0]);
|
|
|
+ }
|
|
|
if (!this.menuItems[index]) return;
|
|
|
if (index && this.mode === 'vertical') {
|
|
|
let indexPath = this.menuItems[index].indexPath;
|