fix: tree-select selectable not work, close #4838
parent
6f0dab1f72
commit
35bcec1e80
|
@ -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 } = node;
|
const { key, disableCheckbox, disabled, selectable } = node;
|
||||||
|
|
||||||
const value = node[fieldValue];
|
const value = node[fieldValue];
|
||||||
const mergedValue = fieldValue in node ? value : key;
|
const mergedValue = fieldValue in node ? value : key;
|
||||||
|
@ -76,6 +76,7 @@ function formatTreeData(
|
||||||
value: mergedValue,
|
value: mergedValue,
|
||||||
title: getLabelProp(node),
|
title: getLabelProp(node),
|
||||||
node,
|
node,
|
||||||
|
selectable,
|
||||||
dataRef: node,
|
dataRef: node,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ export interface DataNode {
|
||||||
disableCheckbox?: boolean;
|
disableCheckbox?: boolean;
|
||||||
checkable?: boolean;
|
checkable?: boolean;
|
||||||
children?: DataNode[];
|
children?: DataNode[];
|
||||||
|
selectable?: boolean;
|
||||||
|
|
||||||
/** Customize data info */
|
/** Customize data info */
|
||||||
[prop: string]: any;
|
[prop: string]: any;
|
||||||
|
@ -32,8 +33,9 @@ export interface InternalDataEntity {
|
||||||
key: Key;
|
key: Key;
|
||||||
value: RawValueType;
|
value: RawValueType;
|
||||||
title?: any;
|
title?: any;
|
||||||
disableCheckbox?: boolean;
|
disableCheckbox: boolean;
|
||||||
disabled?: boolean;
|
disabled: boolean;
|
||||||
|
selectable: boolean;
|
||||||
children?: InternalDataEntity[];
|
children?: InternalDataEntity[];
|
||||||
|
|
||||||
/** Origin DataNode */
|
/** Origin DataNode */
|
||||||
|
|
Loading…
Reference in New Issue