【发布时间】:2018-03-07 19:45:15
【问题描述】:
我的 redux 表单有两个动作,一个是 onclick,我只需要验证一个字段,在第二个动作中我需要提交动作。我怎样才能做到这一点
class BLoginForm extends React.PureComponent{
render(){
const { handleSubmit, pristine, reset, submitting, onSubmit, openForgotForm } = this.props;
return (
<FormCon>
<form onSubmit = { handleSubmit(onSubmit) }>
<Field name = "username" type = "text" component = { BInputPhone } label = "Email or Mobile number" />
<Field name = "password" type = "password" component = { BInput } label = "Password" />
<a onClick = { openForgotForm } >forgot</a>
<div>
<BPrimaryBtn type = "submit" disabled = { submitting }>LOGIN</BPrimaryBtn>
</div>
</form>
</FormCon>
);
}
}
【问题讨论】:
标签: reactjs redux redux-form