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

pull/2153/merge
baiyaaaaa 2017-01-13 18:44:10 +08:00 committed by cinwell.li
parent 04402d5a7a
commit ef06717f64
1 changed files with 12 additions and 1 deletions

View File

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