reduxForm中反写数据在输入框中,数据是从别的模块拉取
// 编辑应用表单 class EditCode extends React.Component { constructor(props) { super(props) } // 取消编辑 handleBack=()=>{ window.history.go(-1); } // 确定编辑 handleFormSubmit=()=>{ const { handleSubmit } = this.props; handleSubmit() } render() { const { handleSubmit, touched, error, pristine, reset, submitting, loading, initAppData } = this.props; return () }}EditCode = reduxForm({ form: 'editAppForm',// 这是你的表单名称 validate, enableReinitialize:true, keepDirtyOnReinitialize:true,// 这个值表示重新初始化表单后,不替换已更改的值,可以用clear来测试})(EditCode) EditCode = connect( state => ({ initialValues: state.appManage.initAppData, //appManage是你需要拉取数据的模块 你需要填充的数据initAppData }), )(EditCode)
export default EditCode
官网链接