uxcore-radiogroup
TL;DR
uxcore-radiogroup ui component for react
setup develop environment
$ git clone https://github.com/uxcore/uxcore-radiogroup$ cd uxcore-radiogroup$ npm install$ gulp server
Usage
let RadioGroup = ;let Item = RadioGroup; Component { superprops; thisstate = {}; } { let me = this; console; me; } { let me = this; return <RadioGroup value=mestatevalue onChange=mehandleChange> <Item value="apple" text="苹果"/> <Item value="banana" text=" 香蕉"/> <Item value="orange" text="橘子"/> </RadioGroup> } moduleexports = Demo;
Demo
http://uxcore.github.io/uxcore/
props
Radiogroup
配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
---|---|---|---|---|
value | string | required | "" | radioGroup 被选中的项 |
onChange | function | required | noop | 点击 radio 时触发,传入参数 value,代表被选中的项 |
disabled | boolean | optional | false | 是否为 disable 状态 |
Radiogroup.Item
配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
---|---|---|---|---|
value | string | required | "" | 该 radio 所代表的值 |
text | string | optional | "" | 该 radio 显示的说明 |
disabled | boolean | optional | - | Item 是否为 disable 状态,具有比 Group 更高的优先级 |