Commit de29e94a by YuMengShuai
parents 27ae0f8b bfe5934f
......@@ -40,7 +40,30 @@ export class CheckboxItem extends Component{
)
}
}
export class CheckboxItem1 extends Component{
constructor(props)
{
super(props)
this.state = {hadBlur:false}
}
setBlur=()=>{
if(!this.state.hadBlur)
this.setState({hadBlur:true})
this.props.onBlur && this.props.onBlur()
}
render()
{
const {InputProps,ItemProps,...res} = this.props
const help = (InputProps && InputProps.formBlur) || this.state.hadBlur ? InputProps.help :''
console.log(InputProps.value)
return (
<FormItem validateStatus={help?"error":null} help={help} {...ItemProps}>
<Checkbox {...InputProps} {...res} checked={InputProps.value=='0'?true:false} onBlur={this.setBlur}/>
</FormItem>
)
}
}
export class CheckboxGroup extends Component{
onChange=checkedValues=>{
this.props.onChange && this.props.onChange(checkedValues)
......
......@@ -14,7 +14,7 @@ export {default as AmountLabel} from './AmountLabel'
export {default as validate} from './Validate2'
export {Label,Section} from './Label'
export {Checkbox,CheckboxItem,CheckboxGroup,CheckboxGroupItem} from './Checkbox'
export {Checkbox,CheckboxItem,CheckboxItem1,CheckboxGroup,CheckboxGroupItem} from './Checkbox'
export {DatePickerItem,DatePicker} from './DatePicker'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment