RadioList组件说明文档
参数说明
hidden:false, // 是否渲染
disabled:false, // 是否disabled
horizontal:true, //横向展示还是竖向展示,true为横向
radioLabel: '111111111', // radio按钮前的label
required: true, //是否显示必选星号
errorStatus:true, //是否报错
errorMsg:"出错了~~~!", //报错信息
onClick:function(val){console.log(val)}, // radion点击回调 val 为传入radiosItem的数据
labelClick: function(val){console.log(val)}, // 文件点击回调 val 为传入radiosItem的数据
radioItems:[ //传入的标签数据,必填
{
value: 0, //number 当前复选框id
bsStyle: true, //bool ,两个值可选:true,false true,必填
isChecked: true, //bool 当前复选框状态 已选/未选 ,必填
text: '内容', //string,标签内容
}
]
组件使用方法
import RadioList from './src/index.js'; //引入CheckboxList组件
state = {
radioItems: [{
value: 0,
bsStyle: false,
isChecked: false,
text: '内容0'
},
{
value: 1,
bsStyle: true,
isChecked: false,
text: '内容1'
},
{
value: 2,
bsStyle: true,
isChecked: false,
text: '内容2'
}]
}
//定义传入组件的数据
使用组件
<RadioList {...this.state} /> //将数据传入组件