Radio
import { Radio } from 'wisteria-ui';用法
基本使用
<Radio>单选框</Radio>
<Radio disabled>禁用</Radio>自定义颜色
<Radio checked color="red">红色</Radio>
<Radio checked color="orange">橙色</Radio>
<Radio checked color="violet">紫罗兰色</Radio>单选框组
<Radio.Group name="demo" defaultValue="A">
<Radio value="A">A</Radio>
<Radio value="B">B</Radio>
<Radio value="C">C</Radio>
<Radio value="D">D</Radio>
</Radio.Group>API
Radio 组件支持原生 HTMLInputElement 属性。
Radio
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| color | 设置选中颜色 | string | - |
| checked | 是否选中 | boolean | - |
| disabled | 是否禁用 | boolean | - |
| ref | - | Ref | - |
| onChange | 回调事件 | (event: TargetedEvent | - |
Radio.Group
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| name | 设置表单项名称 | string | - |
| disabled | 是否禁用 | boolean | - |
| value | radio value | string | number | - |
| defaultValue | 默认选中项 | string | number | - |
| className | 样式类名 | string | - |
| style | 样式 | CSSProperties | - |
| onChange | 回调事件 | function | - |