Skip to content

Commit

Permalink
fix: 修复menu 默认展开的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
motao314 committed Oct 9, 2020
1 parent 75792b7 commit 70fed6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions examples/docs/zh-CN/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
default-active="2"
class="el-menu-vertical-demo"
@open="handleOpen"
@close="handleClose">
@close="handleClose"
:default-openeds="defaultOpeneds"
>
<el-submenu index="1">
<template v-slot:title>
<i class="el-icon-location"></i>
Expand Down Expand Up @@ -132,7 +134,8 @@
@close="handleClose"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b">
active-text-color="#ffd04b"
>
<el-submenu index="1">
<template v-slot:title>
<i class="el-icon-location"></i>
Expand Down Expand Up @@ -175,6 +178,11 @@

<script>
export default {
data(){
return {
defaultOpeneds: ["1","1-4"]
}
},
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath);
Expand Down
2 changes: 1 addition & 1 deletion examples/versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","0.0.12":"2.13"}
{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","0.0.13":"2.13"}
1 change: 1 addition & 0 deletions packages/menu/Submenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export default {
parentMenu.value.ctx.addSubmenu(instance)
rootMenu.ctx.addSubmenu(instance)
initPopper()
showPopper.value = rootMenu.ctx.openedMenus.indexOf(index.value) > -1
})
onBeforeUnmount(() => {
Expand Down

0 comments on commit 70fed6f

Please sign in to comment.