1.初始置灰
componentDidMount() {
// To disabled submit button at the beginning.
this.props.form.validateFields();
}
2.置灰不显示报错
判断是否有错和输入框是否有空
hasErrors = (fieldsError) => {
return Object.keys(fieldsError).some(field => fieldsError[field])
||Object.keys(this.props.form.getFieldsValue()).some(field => this.props.form.getFieldsValue()[field]===undefined);
}
网友评论