React-Antd的小总结(持续更新中)

580 阅读1分钟

Form

Form表单 input框输入的值小写转大写

// getFieldDecorator(id, options)
<FormItem label="姓名">
  	{getFieldDecorator('name', {
        initialValue: '',
        // options.normalize => 转换默认的 value 给控件
        normalize(name)=>{
            if(name!=null){
                return name.toUpperCase()
            }
        },
    })(<Input />)}
</FormItem>