UNPKG

@alicd/crui-checkbox-field

Version:

复选框, FormItem + Checkbox【 @alicd/next 】 的功能融合,同时支持了 x-bind 双向绑定, rules 规则配置,name 表单 name 属性

23 lines (19 loc) 683 B
import React from 'react'; import Checkbox from '@alicd/crui-checkbox'; import FormItem from '@alicd/crui-form-item'; class CheckboxField extends React.Component { render() { let {className , ...other1} = this.props; const {bind, style, inputStyle, children, ...other} = other1; const {labelCol, wrapperCol, mapping, ...otherInput} = other; if(className){ className += " next-form-text-align"; } else { className = "next-form-text-align"; } return (<FormItem className={className} {...other} style={style}> <Checkbox {...otherInput} style={inputStyle}>{ children }</Checkbox> </FormItem>); } } export default CheckboxField;