Skip to content

Commit

Permalink
fix: treeSelect isLeaf not work #4883
Browse files Browse the repository at this point in the history
close #4883
  • Loading branch information
tangjinzhou committed Nov 20, 2021
1 parent 5af08c0 commit 67066e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/vc-tree-select/hooks/useTreeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function formatTreeData(

function dig(dataNodes: DataNode[]) {
return (dataNodes || []).map(node => {
const { key, disableCheckbox, disabled, checkable, selectable } = node;
const { key, disableCheckbox, disabled, checkable, selectable, isLeaf } = node;

const value = node[fieldValue];
const mergedValue = fieldValue in node ? value : key;
Expand All @@ -77,6 +77,7 @@ function formatTreeData(
title: getLabelProp(node),
node,
selectable,
isLeaf,
dataRef: node,
checkable,
};
Expand Down
1 change: 1 addition & 0 deletions components/vc-tree-select/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface InternalDataEntity {
disableCheckbox: boolean;
disabled: boolean;
selectable: boolean;
isLeaf: boolean;
children?: InternalDataEntity[];

/** Origin DataNode */
Expand Down

0 comments on commit 67066e2

Please sign in to comment.