()
| 21 | } |
| 22 | |
| 23 | render() { |
| 24 | const { getFieldProps, getFieldError, isFieldValidating } = this.props.form; |
| 25 | const errors = getFieldError('email'); |
| 26 | return (<div style={ regionStyle }> |
| 27 | <div>email validate onBlur</div> |
| 28 | <div> |
| 29 | <input {...getFieldProps('email', { |
| 30 | initialValue: '', |
| 31 | validateFirst: true, |
| 32 | rules: [ |
| 33 | { |
| 34 | required: true, |
| 35 | }, |
| 36 | { |
| 37 | type: 'email', |
| 38 | message: '错误的 email 格式', |
| 39 | }, |
| 40 | this.checkSpecial, |
| 41 | ], |
| 42 | validateTrigger: 'onBlur', |
| 43 | })} |
| 44 | /></div> |
| 45 | <div style={errorStyle}> |
| 46 | {errors ? errors.join(',') : null} |
| 47 | </div> |
| 48 | <div style={errorStyle}> |
| 49 | {isFieldValidating('email') ? 'validating' : null} |
| 50 | </div> |
| 51 | </div>); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | class Form extends Component { |
nothing calls this directly
no test coverage detected