소스 검색

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();