File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ export default () => {
6161
6262 const [ value2 , setValue2 ] = React . useState < string [ ] [ ] > ( [ ] ) ;
6363
64+ const [ disabled , setDisabled ] = React . useState ( false ) ;
65+
6466 return (
6567 < >
6668 < h1 > Panel</ h1 >
@@ -71,13 +73,21 @@ export default () => {
7173 >
7274 Set Value
7375 </ button >
76+ < button
77+ onClick = { ( ) => {
78+ setDisabled ( prev => ! prev ) ;
79+ } }
80+ >
81+ { disabled ? 'enable panel' : 'disable panel' }
82+ </ button >
7483 < Cascader . Panel
7584 value = { value }
7685 options = { addressOptions }
7786 onChange = { nextValue => {
7887 console . log ( 'Change:' , nextValue ) ;
7988 setValue ( nextValue ) ;
8089 } }
90+ disabled = { disabled }
8191 />
8292
8393 < Cascader . Panel
@@ -88,10 +98,9 @@ export default () => {
8898 console . log ( 'Change:' , nextValue ) ;
8999 setValue2 ( nextValue ) ;
90100 } }
101+ disabled = { disabled }
91102 />
92103
93- < Cascader . Panel disabled options = { addressOptions } />
94-
95104 < Cascader . Panel options = { addressOptions } direction = "rtl" />
96105
97106 < Cascader . Panel notFoundContent = "Empty!!!" />
You can’t perform that action at this time.
0 commit comments