fix: tree-select selectable not work, close #4838

pull/4839/head^2
tangjinzhou 2021-11-02 17:04:34 +08:00
parent 6f0dab1f72
commit 35bcec1e80
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -23,6 +23,7 @@ export interface DataNode {
disableCheckbox?: boolean;
checkable?: boolean;
children?: DataNode[];
selectable?: boolean;
/** Customize data info */
[prop: string]: any;
@ -32,8 +33,9 @@ export interface InternalDataEntity {
key: Key;
value: RawValueType;
title?: any;
disableCheckbox?: boolean;
disabled?: boolean;
disableCheckbox: boolean;
disabled: boolean;
selectable: boolean;
children?: InternalDataEntity[];
/** Origin DataNode */