Appearance
Radio 单选框
单选控件,支持单独使用或以 Group 批量管理。
基础用法
当前:未选中
禁用状态
单选框组
通过 ARadioGroup 实现互斥单选,options 配置选项列表。
已选:无
API
ARadio Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| modelValue | boolean | — | 受控选中状态 |
| defaultChecked | boolean | false | 非受控初始选中状态 |
| size | 'sm' | 'md' | 'lg' | 'md' | 尺寸 |
| disabled | boolean | false | 禁用 |
| value | string | number | — | 在 Group 中的值标识 |
ARadio Events
| 事件名 | 回调参数 | 说明 |
|---|---|---|
| update:modelValue | (checked: boolean) | 选中状态变更 |
| change | (checked: boolean) | 选中状态变更 |
ARadioGroup Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| modelValue | string | number | — | 受控选中值 |
| defaultValue | string | number | — | 非受控初始值 |
| options | RadioOption[] | [] | 选项列表 |
| disabled | boolean | — | 整组禁用 |
RadioOption
| 属性 | 类型 | 说明 |
|---|---|---|
| label | string | 显示文字 |
| value | string | number | 值 |
| disabled | boolean | 是否禁用 |