fix: menu trigger inlineCollapsed not have animation #200

pull/225/head
tangjinzhou 2018-09-21 21:46:42 +08:00
parent b604fd5c0a
commit a9f31fc477
1 changed files with 6 additions and 4 deletions

View File

@ -50,7 +50,7 @@ const Menu = {
prop: 'selectedKeys',
event: 'selectChange',
},
mounted () {
created () {
this.preProps = { ...this.$props }
},
watch: {
@ -63,6 +63,7 @@ const Menu = {
}
if (hasProp(this, 'openKeys')) {
this.setState({ sOpenKeys: nextProps.openKeys })
this.preProps = { ...nextProps }
return
}
if (nextProps.inlineCollapsed && !preProps.inlineCollapsed) {
@ -108,10 +109,11 @@ const Menu = {
this.leaveAnimationExecutedWhenInlineCollapsed = false
this.inlineOpenKeys = []
let sOpenKeys
if (hasProp(this, 'defaultOpenKeys')) {
sOpenKeys = props.defaultOpenKeys
} else if (hasProp(this, 'openKeys')) {
if (hasProp(this, 'openKeys')) {
sOpenKeys = props.openKeys
} else if (hasProp(this, 'defaultOpenKeys')) {
sOpenKeys = props.defaultOpenKeys
}
return {
sOpenKeys,