antd

2023-02-27 reactjs

# form 基本使用

<form
 name="form"
 ref="form"
 onFinish="this.methods"
 layout="vertical" // horizontal
 scrollToFirstError //校验失败自动滚动到第一个错误处
 initialValues={} // initialValue 初始值 不能用setValues更改、使用
                  // 使用setFieldsValue
 onFinish={this.onFinish} //校验通过的callback
 labelCol={span:4}
 wrapperCol={span:20}

>
</form>



# form API

const ref = React.createRef() //Form表单ref绑定 ref

this.ref.current.setFieldsValue({key:'value'}) //表单赋值、数据回显

this.ref.current.resetFields() //表单重置


# select

最后更新于: 2023年5月25日 14:33