|
@@ -13,8 +13,9 @@
|
|
|
:default-active="activeMenu"
|
|
:default-active="activeMenu"
|
|
|
style="border-right: 1px solid #545c64;"
|
|
style="border-right: 1px solid #545c64;"
|
|
|
class="el-menu-vertical-demo"
|
|
class="el-menu-vertical-demo"
|
|
|
|
|
+ ref="menu"
|
|
|
>
|
|
>
|
|
|
- <sys-menu v-for="item in menus" :menu="item" :key="item.id"> </sys-menu>
|
|
|
|
|
|
|
+ <sys-menu v-for="item in menus" @open="open" :menu="item" :key="item.id"> </sys-menu>
|
|
|
</el-menu>
|
|
</el-menu>
|
|
|
</el-aside>
|
|
</el-aside>
|
|
|
<el-container>
|
|
<el-container>
|
|
@@ -191,6 +192,15 @@ export default {
|
|
|
parents_copy.push(i);
|
|
parents_copy.push(i);
|
|
|
this.menuPath = parents_copy.map(i => i.name);
|
|
this.menuPath = parents_copy.map(i => i.name);
|
|
|
this.activeMenu = '' + i.id;
|
|
this.activeMenu = '' + i.id;
|
|
|
|
|
+ if (i.children) {
|
|
|
|
|
+ let child = i.children.find(_child => {
|
|
|
|
|
+ return _child.path === path;
|
|
|
|
|
+ });
|
|
|
|
|
+ if (!!child) {
|
|
|
|
|
+ parents_copy.push(i);
|
|
|
|
|
+ findActiveMenu(parents_copy, i.children);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
if (i.children) {
|
|
if (i.children) {
|
|
|
parents_copy.push(i);
|
|
parents_copy.push(i);
|
|
@@ -280,6 +290,13 @@ export default {
|
|
|
this.captcha = res.image;
|
|
this.captcha = res.image;
|
|
|
this.pwdForm.key = res.key;
|
|
this.pwdForm.key = res.key;
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ open(index) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$refs.menu.open(index);
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|