mirror of https://github.com/ElemeFE/element
Menu: fix typo activedIndex -> activeIndex
parent
94d7ca7535
commit
66aa58fd99
|
@ -48,7 +48,7 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
active() {
|
active() {
|
||||||
return this.index === this.rootMenu.activedIndex;
|
return this.index === this.rootMenu.activeIndex;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activedIndex: this.defaultActive,
|
activeIndex: this.defaultActive,
|
||||||
openedMenus: this.defaultOpeneds ? this.defaultOpeneds.slice(0) : [],
|
openedMenus: this.defaultOpeneds ? this.defaultOpeneds.slice(0) : [],
|
||||||
items: {},
|
items: {},
|
||||||
submenus: {}
|
submenus: {}
|
||||||
|
@ -126,10 +126,10 @@
|
||||||
defaultActive(value) {
|
defaultActive(value) {
|
||||||
const item = this.items[value];
|
const item = this.items[value];
|
||||||
if (item) {
|
if (item) {
|
||||||
this.activedIndex = item.index;
|
this.activeIndex = item.index;
|
||||||
this.initOpenedMenu();
|
this.initOpenedMenu();
|
||||||
} else {
|
} else {
|
||||||
this.activedIndex = '';
|
this.activeIndex = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
},
|
},
|
||||||
handleItemClick(item) {
|
handleItemClick(item) {
|
||||||
let { index, indexPath } = item;
|
let { index, indexPath } = item;
|
||||||
this.activedIndex = item.index;
|
this.activeIndex = item.index;
|
||||||
this.$emit('select', index, indexPath, item);
|
this.$emit('select', index, indexPath, item);
|
||||||
|
|
||||||
if (this.mode === 'horizontal' || this.collapse) {
|
if (this.mode === 'horizontal' || this.collapse) {
|
||||||
|
@ -194,7 +194,7 @@
|
||||||
},
|
},
|
||||||
// 初始化展开菜单
|
// 初始化展开菜单
|
||||||
initOpenedMenu() {
|
initOpenedMenu() {
|
||||||
const index = this.activedIndex;
|
const index = this.activeIndex;
|
||||||
const activeItem = this.items[index];
|
const activeItem = this.items[index];
|
||||||
if (!activeItem || this.mode === 'horizontal' || this.collapse) return;
|
if (!activeItem || this.mode === 'horizontal' || this.collapse) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue