File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import TreeSelect from '../src';
3
3
4
4
export default ( ) => {
5
5
const [ value , setValue ] = useState < string [ ] > ( [ '1' ] ) ;
6
+ const [ checkValue , setCheckValue ] = useState < string [ ] > ( [ '1' ] ) ;
6
7
7
8
const treeData = [
8
9
{
@@ -15,6 +16,11 @@ export default () => {
15
16
value : '1-1' ,
16
17
title : '1-1' ,
17
18
} ,
19
+ {
20
+ key : '1-2' ,
21
+ value : '1-2' ,
22
+ title : '1-2' ,
23
+ } ,
18
24
] ,
19
25
} ,
20
26
{
@@ -38,6 +44,10 @@ export default () => {
38
44
setValue ( val ) ;
39
45
} ;
40
46
47
+ const onCheckChange = ( val : string [ ] ) => {
48
+ setCheckValue ( val ) ;
49
+ } ;
50
+
41
51
return (
42
52
< >
43
53
< h2 > multiple with maxCount</ h2 >
@@ -48,12 +58,23 @@ export default () => {
48
58
style = { { width : 300 } }
49
59
multiple
50
60
treeCheckable
51
- treeCheckStrictly
52
61
maxCount = { 3 }
53
62
treeData = { treeData }
54
63
onChange = { onChange }
55
64
value = { value }
56
65
/>
66
+
67
+ < h2 > checkable with maxCount and treeCheckStrictly</ h2 >
68
+ < TreeSelect
69
+ style = { { width : 300 } }
70
+ multiple
71
+ treeCheckable
72
+ treeCheckStrictly
73
+ maxCount = { 3 }
74
+ treeData = { treeData }
75
+ onChange = { onCheckChange }
76
+ value = { checkValue }
77
+ />
57
78
</ >
58
79
) ;
59
80
} ;
You can’t perform that action at this time.
0 commit comments