浏览代码

Menu: fix typo activedIndex -> activeIndex

Kordan Ou 8 年之前
父节点
当前提交
66aa58fd99
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      packages/menu/src/menu-item.vue
  2. 5 5
      packages/menu/src/menu.vue

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

@@ -48,7 +48,7 @@
     },
     computed: {
       active() {
-        return this.index === this.rootMenu.activedIndex;
+        return this.index === this.rootMenu.activeIndex;
       }
     },
     methods: {

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

@@ -116,7 +116,7 @@
     },
     data() {
       return {
-        activedIndex: this.defaultActive,
+        activeIndex: this.defaultActive,
         openedMenus: this.defaultOpeneds ? this.defaultOpeneds.slice(0) : [],
         items: {},
         submenus: {}
@@ -126,10 +126,10 @@
       defaultActive(value) {
         const item = this.items[value];
         if (item) {
-          this.activedIndex = item.index;
+          this.activeIndex = item.index;
           this.initOpenedMenu();
         } else {
-          this.activedIndex = '';
+          this.activeIndex = '';
         }
 
       },
@@ -181,7 +181,7 @@
       },
       handleItemClick(item) {
         let { index, indexPath } = item;
-        this.activedIndex = item.index;
+        this.activeIndex = item.index;
         this.$emit('select', index, indexPath, item);
 
         if (this.mode === 'horizontal' || this.collapse) {
@@ -194,7 +194,7 @@
       },
       // 初始化展开菜单
       initOpenedMenu() {
-        const index = this.activedIndex;
+        const index = this.activeIndex;
         const activeItem = this.items[index];
         if (!activeItem || this.mode === 'horizontal' || this.collapse) return;