feat: tree selectedKeys & selectedKeys support `.sync` modifier

pull/398/head
tangjinzhou 2018-12-26 18:07:50 +08:00
parent af361f7123
commit 6373ce8e92
2 changed files with 4 additions and 1 deletions

View File

@ -144,6 +144,7 @@ export default {
}
newState._selectedKeys = newSelectedKeys
this.$emit('update:selectedKeys', newSelectedKeys)
this.$emit('select', newSelectedKeys, event)
this.setUncontrolledState(newState)
@ -188,7 +189,7 @@ export default {
ref: 'tree',
class: `${prefixCls}-directory`,
on: {
...this.$listeners,
...omit(this.$listeners, ['update:selectedKeys']),
select: this.onSelect,
click: this.onClick,
doubleclick: this.onDoubleClick,

View File

@ -395,6 +395,7 @@ const Tree = {
selectedNodes,
nativeEvent: e,
}
this.__emit('update:selectedKeys', selectedKeys)
this.__emit('select', selectedKeys, eventObj)
},
onNodeCheck (e, treeNode, checked) {
@ -516,6 +517,7 @@ const Tree = {
expanded: targetExpanded,
nativeEvent: e,
})
this.__emit('update:expandedKeys', expandedKeys)
// Async Load data
if (targetExpanded && loadData) {