Bläddra i källkod

Revert "fix first enter do not active the menu bug (#2399)"

This reverts commit ef06717f64bc1a54c10b6549948056669ab5a85c.
baiyaaaaa 8 år sedan
förälder
incheckning
e27675114b
1 ändrade filer med 1 tillägg och 12 borttagningar
  1. 1 12
      packages/menu/src/menu.vue

+ 1 - 12
packages/menu/src/menu.vue

@@ -57,15 +57,6 @@
       },
       defaultOpeneds(value) {
         this.openedMenus = value;
-      },
-      '$route': {
-        immediate: true,
-        handler(value) {
-          if (this.router) {
-            this.activedIndex = value.path;
-            this.initOpenedMenu();
-          }
-        }
       }
     },
     methods: {
@@ -109,7 +100,7 @@
       },
       handleItemClick(item) {
         let { index, indexPath } = item;
-
+        this.activedIndex = item.index;
         this.$emit('select', index, indexPath, item);
 
         if (this.mode === 'horizontal') {
@@ -118,8 +109,6 @@
 
         if (this.router) {
           this.routeToItem(item);
-        } else {
-          this.activedIndex = item.index;
         }
       },
       // 初始化展开菜单