You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design/components/radio/index.md

33 lines
1.0 KiB
Markdown

# Radio
10 years ago
- category: Components
- chinese: 单选框
10 years ago
- order: 2
10 years ago
---
## 何时使用
- 用于在多个备选项中选中单个状态。
- 和 Select 的区别是Radio 所有选项默认可见,方便用户在比较中选择,因此选项不宜过多。
10 years ago
## API
10 years ago
### Radio
单选框。
| 参数 | 说明 | 类型 | 必选值 | 默认值 |
|----------------|------------------------------------------|------------|---------|--------|
| checked | 指定当前是否选中 | boolean | false | false |
| defaultChecked | 初始是否选中 | boolean | false | false |
| value | 组合时根据此项判定checked | -- |true | null|
### RadioGroup
单选框组合;
10 years ago
10 years ago
| 参数 | 说明 | 类型 | 必选值 | 默认值 |
|----------------|------------------------------------------|------------|---------|--------|
10 years ago
| onChange | 变化时回调函数,组合时必须 | Function(e:Event) | false | null |