|
@@ -251,15 +251,19 @@
|
|
|
handleItemClick(item) {
|
|
|
const { index, indexPath } = item;
|
|
|
const oldActiveIndex = this.activeIndex;
|
|
|
+ const hasIndex = item.index !== null;
|
|
|
+
|
|
|
+ if (hasIndex) {
|
|
|
+ this.activeIndex = item.index;
|
|
|
+ }
|
|
|
|
|
|
- this.activeIndex = item.index;
|
|
|
this.$emit('select', index, indexPath, item);
|
|
|
|
|
|
if (this.mode === 'horizontal' || this.collapse) {
|
|
|
this.openedMenus = [];
|
|
|
}
|
|
|
|
|
|
- if (this.router) {
|
|
|
+ if (this.router && hasIndex) {
|
|
|
this.routeToItem(item, (error) => {
|
|
|
this.activeIndex = oldActiveIndex;
|
|
|
if (error) console.error(error);
|