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[]) { function dig(dataNodes: DataNode[]) {
return (dataNodes || []).map(node => { return (dataNodes || []).map(node => {
const { key, disableCheckbox, disabled, checkable, selectable } = node; const { key, disableCheckbox, disabled, checkable, selectable, isLeaf } = node;
const value = node[fieldValue]; const value = node[fieldValue];
const mergedValue = fieldValue in node ? value : key; const mergedValue = fieldValue in node ? value : key;
@ -77,6 +77,7 @@ function formatTreeData(
title: getLabelProp(node), title: getLabelProp(node),
node, node,
selectable, selectable,
isLeaf,
dataRef: node, dataRef: node,
checkable, checkable,
}; };

View File

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