pull/9/head
tangjinzhou 2018-01-29 19:02:18 +08:00
parent 804a1eba18
commit bbc4a235a2
1 changed files with 6 additions and 4 deletions

View File

@ -33,14 +33,16 @@ const Menu = {
watch: {
'$props': {
handler: function (nextProps) {
const props = {}
if (hasProp(this, 'selectedKeys')) {
props.sSelectedKeys = nextProps.selectedKeys || []
this.setState({
sSelectedKeys: nextProps.selectedKeys || [],
})
}
if (hasProp(this, 'openKeys')) {
props.sOpenKeys = nextProps.openKeys || []
this.setState({
sOpenKeys: nextProps.openKeys || [],
})
}
this.setState(props)
},
deep: true,
},