File tree Expand file tree Collapse file tree 3 files changed +11
-20
lines changed
Expand file tree Collapse file tree 3 files changed +11
-20
lines changed Original file line number Diff line number Diff line change 11import '../../assets/index.less' ;
22import React , { useState } from 'react' ;
3- import type { SwitchChangeEventHandler } from 'rc-switch' ;
4- import Switch from 'rc-switch' ;
3+ import type { SwitchChangeEventHandler } from '@ rc-component/ switch' ;
4+ import Switch from '@ rc-component/ switch' ;
55
66const onChange : SwitchChangeEventHandler = ( value , event ) => {
77 // eslint-disable-next-line no-console
88 console . log ( `switch checked: ${ value } ` , event ) ;
9- }
9+ } ;
1010
1111export default ( ) => {
1212 const [ disabled , setDisabled ] = useState ( false ) ;
1313
1414 const toggle = ( ) => {
1515 setDisabled ( ( prev ) => ! prev ) ;
16- }
16+ } ;
1717
1818 return (
1919 < div style = { { margin : 20 } } >
20- < Switch
21- onChange = { onChange }
22- disabled = { disabled }
23- checkedChildren = "开"
24- unCheckedChildren = "关"
25- />
20+ < Switch onChange = { onChange } disabled = { disabled } checkedChildren = "开" unCheckedChildren = "关" />
2621 < div style = { { marginTop : 20 } } >
2722 < button type = "button" onClick = { toggle } >
2823 toggle disabled
2924 </ button >
3025 </ div >
3126 </ div >
32- )
33- }
27+ ) ;
28+ } ;
Original file line number Diff line number Diff line change 4343 ]
4444 },
4545 "dependencies" : {
46- "@babel/runtime" : " ^7.21.0" ,
4746 "classnames" : " ^2.2.1" ,
48- "rc-util" : " ^5.30 .0"
47+ "@ rc-component/ util" : " ^1.2 .0"
4948 },
5049 "devDependencies" : {
5150 "@rc-component/father-plugin" : " ^2.0.0" ,
6564 "husky" : " ^8.0.1" ,
6665 "less" : " ^4.1.3" ,
6766 "lint-staged" : " ^15.1.0" ,
68- "np" : " ^9 .0.0 " ,
67+ "@rc-component/ np" : " ^1 .0.3 " ,
6968 "prettier" : " ^3.1.0" ,
7069 "react" : " ^16.0.0" ,
7170 "react-dom" : " ^16.0.0" ,
Original file line number Diff line number Diff line change 1313 "skipLibCheck" : true ,
1414 "declaration" : true ,
1515 "paths" : {
16- "rc-switch" : [" src/index.tsx" ],
17- "@@/*" : [" .dumi/tmp/*" ],
18- "@rc-component/switch" : [
19- " src/"
20- ]
16+ "@rc-component/switch" : [" src/" ],
17+ "@@/*" : [" .dumi/tmp/*" ]
2118 }
2219 }
2320}
You can’t perform that action at this time.
0 commit comments