浏览代码

Menu: save menu state when change collapse and expand menu(#10622) (#12178)

Harlan 7 年之前
父节点
当前提交
6bb49b9590
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/menu/src/menu.vue

+ 2 - 2
packages/menu/src/menu.vue

@@ -153,8 +153,8 @@
       }
     },
     methods: {
-      updateActiveIndex() {
-        const item = this.items[this.defaultActive];
+      updateActiveIndex(val) {
+        const item = this.items[val] || this.items[this.activeIndex] || this.items[this.defaultActive];
         if (item) {
           this.activeIndex = item.index;
           this.initOpenedMenu();