From e8d29df97f4c0ebb49dd11f7220175c7dcdf4d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Thu, 19 Sep 2024 18:31:47 +0800 Subject: [PATCH] fix(tree-select): fix multiple select click parent node callback (#4579) --- src/tree-select/tree-select.tsx | 5 +---- src/tree/hooks/useRenderLabel.tsx | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/tree-select/tree-select.tsx b/src/tree-select/tree-select.tsx index 99e0f12b79..cf65107f85 100644 --- a/src/tree-select/tree-select.tsx +++ b/src/tree-select/tree-select.tsx @@ -158,7 +158,6 @@ export default defineComponent({ return props.keys?.children || 'children'; }); - // timelifes onMounted(async () => { if (!treeSelectValue.value && props.defaultValue) { await change(props.defaultValue, null, 'uncheck'); @@ -175,8 +174,6 @@ export default defineComponent({ changeNodeInfo(); }); - // methods - const change = ( valueParam: TreeSelectValue, node: TreeNodeModel, @@ -360,7 +357,7 @@ export default defineComponent({ onActive={treeNodeActive} onExpand={treeNodeExpand} onLoad={treeNodeLoad} - expandOnClickNode + expandOnClickNode={false} v-slots={{ empty: () => renderDefaultTNode('empty', { diff --git a/src/tree/hooks/useRenderLabel.tsx b/src/tree/hooks/useRenderLabel.tsx index 3bf2940d2d..a5b5cb1e0f 100644 --- a/src/tree/hooks/useRenderLabel.tsx +++ b/src/tree/hooks/useRenderLabel.tsx @@ -70,7 +70,7 @@ export default function useRenderLabel(state: TypeTreeItemState) { name={String(node.value)} onChange={handleChange} stopLabelTrigger={shouldStopLabelTrigger.value} - ignore="expand,active" + ignore={treeProps.expandOnClickNode ? 'active' : 'expand,active'} props={itemCheckProps} > {labelNode}