单选钮

介绍
在一组相关且互斥数据中,用户仅能选择一个选项。
API
Props
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| status | 状态 | 'default' |'disabled'| 'hide'|'readonly' | 'default' |
| title | 标题 | string | - |
| showLabel | 显示标题 | boolean | true |
| width | 字段占比 | '25%'|'50%'|'75%'|'100%' | '100%' |
| labelWidth | 标签宽度 | string | - |
| value | 默认值 | string | - |
| name | 数据字段 | string | - |
| type | 展示形状 | 'radio'|'button' | 'radio' |
| direction | 排列方式 | 'horizontal'|'vertical' | 'horizontal' |
| isColor | 彩色 | boolean | false |
| options | 选项配置 | Options | - |
| baseStyle | 自定义样式 | string | - |
| customClass | 类名绑定 , 绑定类的名称 | string | - |
| boxStyle | 盒模型 , margin,border,padding设置 | BoxStyle | - |
| uniqueKey | 唯一标识 , 组件的唯一标识 | string | - |
| customRender | 自定义单选钮内容 | boolean | false |
| renderFunc | 自定义单选钮内容渲染函数 | Function | 'function render(ctx, params) {\n // 返回jsx渲染内容\n return {params.item.value}\n}' |
| extra | 补充说明 | string | - |
| tip | 气泡提醒 | string | - |
| validate | 校验 | Validate | - |
| loop | 循环, 循环渲染设置 | Loop | - |
Props-选项配置
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| key | 选项值 | string | - |
| value | 标题 | string | - |
| color | 颜色 | 'default'|'cyan'|'red'| 'green'|'lime'| 'orange'|'orangered'|'gold'|'purple'| 'magenta'|'blue'|'gray'|'pinkpurple' | - |
| default | 默认选中 | boolean | false |
| disabled | 禁用 | boolean | - |
Events
| 事件名 | 描述 | 参数 |
|---|---|---|
| onChange | 值发生改变时 | ctx params: {value: string} loop:LoopParams |
Type
javascript
// 选项配置
type Options = {
"key":string,
"value":string,
"default":boolean,
"color":"default"\|"cyan"\|"red"\|"green"\|"lime"\|"orange"\|"orangered"\|"gold"\|"purple"\|"magenta"\|"blue"\|"gray"\|"pinkpurple",
"disabled":boolean
}