Commit 30003ec5 authored by baiyaaaaa's avatar baiyaaaaa Committed by cinwell.li

fix menu router prop bug when vertical mode

parent c44fa410
......@@ -15,6 +15,7 @@
- 为 Tree 添加 getCheckedNodes 方法和 node-click、check-change 回调
- 新增 DatePicker 禁用日期功能 #253
- 修复 多选可搜索的 Select 下拉选项自动展开的问题
- 修复 Menu 组件垂直模式下开启 router 属性会立刻跳转的问题 #295
#### 非兼容性更新
......
......@@ -28,7 +28,7 @@
},
methods: {
handleClick() {
this.rootMenu.handleSelect(this.index, this.indexPath, this.route);
this.rootMenu.handleSelect(this.index, this.indexPath, this.route || this.index);
}
},
created() {
......
......@@ -99,17 +99,21 @@
});
}
if (this.router) {
this.$router.push(route || index);
if (this.router && route) {
this.$router.push(route);
}
}
},
mounted() {
let index = this.activeIndex;
if (index) {
if (index && this.mode === 'vertical') {
let indexPath = this.menuItems[index].indexPath;
this.handleSelect(index, indexPath);
// 展开该菜单项的路径上所有子菜单
indexPath.forEach(index => {
let submenu = this.submenus[index];
submenu && this.openMenu(index, submenu.indexPath);
});
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment