Skip to content

Commit 35bcec1

Browse files
committed
fix: tree-select selectable not work, close #4838
1 parent 6f0dab1 commit 35bcec1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/vc-tree-select/hooks/useTreeData.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function formatTreeData(
6464

6565
function dig(dataNodes: DataNode[]) {
6666
return (dataNodes || []).map(node => {
67-
const { key, disableCheckbox, disabled } = node;
67+
const { key, disableCheckbox, disabled, selectable } = node;
6868

6969
const value = node[fieldValue];
7070
const mergedValue = fieldValue in node ? value : key;
@@ -76,6 +76,7 @@ function formatTreeData(
7676
value: mergedValue,
7777
title: getLabelProp(node),
7878
node,
79+
selectable,
7980
dataRef: node,
8081
};
8182

components/vc-tree-select/interface.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface DataNode {
2323
disableCheckbox?: boolean;
2424
checkable?: boolean;
2525
children?: DataNode[];
26+
selectable?: boolean;
2627

2728
/** Customize data info */
2829
[prop: string]: any;
@@ -32,8 +33,9 @@ export interface InternalDataEntity {
3233
key: Key;
3334
value: RawValueType;
3435
title?: any;
35-
disableCheckbox?: boolean;
36-
disabled?: boolean;
36+
disableCheckbox: boolean;
37+
disabled: boolean;
38+
selectable: boolean;
3739
children?: InternalDataEntity[];
3840

3941
/** Origin DataNode */

0 commit comments

Comments
 (0)