fix: treeSelect isLeaf not work #4883

close #4883
pull/4882/head
tangjinzhou 2021-11-20 21:45:28 +08:00
parent 5af08c0904
commit 67066e2fb6
2 changed files with 3 additions and 1 deletions

View File

@ -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;
@ -77,6 +77,7 @@ function formatTreeData(
title: getLabelProp(node),
node,
selectable,
isLeaf,
dataRef: node,
checkable,
};

View File

@ -37,6 +37,7 @@ export interface InternalDataEntity {
disableCheckbox: boolean;
disabled: boolean;
selectable: boolean;
isLeaf: boolean;
children?: InternalDataEntity[];
/** Origin DataNode */