mirror of https://github.com/ElemeFE/element
Merge pull request #456 from QingWei-Li/fix/menu/active
Menu: fix indexPath of undefinedpull/460/head
commit
426ce5da36
|
@ -46,6 +46,7 @@
|
||||||
watch: {
|
watch: {
|
||||||
defaultActive(value) {
|
defaultActive(value) {
|
||||||
this.activeIndex = value;
|
this.activeIndex = value;
|
||||||
|
if (!this.menuItems[value]) return;
|
||||||
let indexPath = this.menuItems[value].indexPath;
|
let indexPath = this.menuItems[value].indexPath;
|
||||||
|
|
||||||
this.handleSelect(value, indexPath);
|
this.handleSelect(value, indexPath);
|
||||||
|
@ -97,6 +98,7 @@
|
||||||
},
|
},
|
||||||
openActiveItemMenus() {
|
openActiveItemMenus() {
|
||||||
let index = this.activeIndex;
|
let index = this.activeIndex;
|
||||||
|
if (!this.menuItems[index]) return;
|
||||||
if (index && this.mode === 'vertical') {
|
if (index && this.mode === 'vertical') {
|
||||||
let indexPath = this.menuItems[index].indexPath;
|
let indexPath = this.menuItems[index].indexPath;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue