何时使用
- 开关选择器,适用于需要表示两种状态(如开启和关闭)之间的切换时。
| 展示形态 | 预览 | 进度 |
|---|---|---|
| 基础形态 | ![]() |
完成 |
| 自定义开关大小 | ![]() |
完成 |
| 自定义开关内容 | ![]() |
完成 |
类型定义
export type SwitchCfg = {x?: number;y?: number;size?: number;style?: MixAttrs<Partial<RectProps>>;checked?: boolean;disabled?: boolean;defaultChecked?: boolean;checkedChildren?: TagCfg;unCheckedChildren?: TagCfg;onChange?: (checked: boolean) => void;onClick?: (e: Event, checked: boolean) => void;};



