Radio
单选框组件。
Install
1. npm install beeshell
Usage
引入方式
全部引入
1. import { Radio } from 'beeshell';
单独引入
1. import Radio from 'beeshell/components/Radio';
Examples

Code
2. import { Radio } from 'beeshell';
4. <Radio checkedValue={this.state.deliveryTime} onChange={() => {}}>
5. <Radio.Item key={'a'} label="百度" trueValue="1" />
6. <Radio.Item key={'b'} label="阿里" trueValue="2" />
7. <Radio.Item key={'c'} label="腾讯" trueValue="3" />
8. </Radio>
通常与 Form 一起使用,详见 Form
Radio Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| checkedValue | Any | false | null | 默认选中的值,其中的值就是 Radio.Item 的 label 或者 trueValue(优先级高),再次被设置时会相应改变, 并联动全选状态的改变 |
| showAllChecked | Boolean | false | false | 是否展示全选按钮 |
| onChange | Function | false | null | 选项变化回调 |
| iconPosition | String | false | ‘left’ | 选项扭 icon 位置 |
Radio.Item Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| label | String | true | null | 选项文案 |
| trueValue | Any | false | null | 选项值 |
| disabled | Boolean | false | false | 禁用选项 |
| checked | Boolean | false | false | 选中 |
