fix default-active bug

This commit is contained in:
baiyaaaaa 2016-10-04 20:10:57 +08:00 committed by cinwell.li
parent 3d60efd468
commit 1405b23ebb
3 changed files with 9 additions and 5 deletions

View File

@ -7,6 +7,8 @@
- 修复 Tabs 切换后 Tab-panel 被销毁的问题
- 修复 TimePicker 错误的隐藏面板
- 修复 Table Cell 的样式, #204
- 修复 Menu default-active 属性不能为空的问题, #200
- 修复 Menu unique-opened 开启后无法展开子菜单的问题, #200
- 为 Notification 和 Message 的不同 type 添加独立的调用方法
- 为 Message Box 和 Dialog 添加 lockScroll 属性,用于定义是否在弹框出现时将 body 滚动锁定
- 新增 Input textarea 类型的 rows, autosize 属性

View File

@ -5,7 +5,7 @@
}
.el-menu-vertical-demo {
width: 200px;
height: 400px;
min-height: 400px;
}
.line {
height: 1px;

View File

@ -64,11 +64,11 @@
let openedMenus = this.openedMenus;
if (openedMenus.indexOf(index) !== -1) return;
if (this.uniqueOpened) {
openedMenus = openedMenus.filter(index => {
this.openedMenus = openedMenus.filter(index => {
return indexPath.indexOf(index) !== -1;
});
}
openedMenus.push(index);
this.openedMenus.push(index);
},
closeMenu(index, indexPath) {
this.openedMenus.splice(this.openedMenus.indexOf(index), 1);
@ -106,9 +106,11 @@
},
mounted() {
let index = this.activeIndex;
if (index) {
let indexPath = this.menuItems[index].indexPath;
this.handleSelect(index, indexPath);
}
}
};
</script>