fix(tree): switcher doesn't trigger expand

This commit is contained in:
07akioni 2021-02-02 23:20:26 +08:00
parent 22b6046c20
commit 8a4d63a5c6
3 changed files with 5 additions and 16 deletions

View File

@ -211,7 +211,7 @@ export default defineComponent({
? treeMateRef.value.getNonLeafKeys()
: props.defaultExpandedKeys || props.expandedKeys
)
const controlledExpandedKeysRef = toRef(props, 'selectedKeys')
const controlledExpandedKeysRef = toRef(props, 'expandedKeys')
const mergedExpandedKeysRef = useMergedState(
controlledExpandedKeysRef,
uncontrolledExpandedKeysRef

View File

@ -1,4 +1,4 @@
import { h, defineComponent } from 'vue'
import { h, defineComponent, PropType } from 'vue'
import { SwitcherIcon } from '../../_internal/icons'
import { NIconSwitchTransition, NBaseLoading, NBaseIcon } from '../../_internal'
@ -17,18 +17,7 @@ export default defineComponent({
type: Boolean,
default: false
},
onClick: Function
},
setup (props) {
function doClick (): void {
const { onClick } = props
if (onClick) onClick()
}
return {
handleClick () {
doClick()
}
}
onClick: Function as PropType<(e: MouseEvent) => void>
},
render () {
return (
@ -40,7 +29,7 @@ export default defineComponent({
'n-tree-node-switcher--hide': this.hide
}
]}
onClick={this.handleClick}
onClick={this.onClick}
>
<div class="n-tree-node-switcher__icon">
<NIconSwitchTransition>

View File

@ -427,7 +427,7 @@
- [ ] on update value api
- [ ] fix upload dragger
- [x] fix table sorter
- [ ] tree 多选节点第二个 demo
- [x] tree 多选节点第二个 demo
- [ ] table treemate!!!
## Info