Closed walk-liuyan closed 6 years ago
Current solution
<FormItem {...formItemLayout} label="密码" validateStatus={passwordError ? 'error' : ''} help={passwordError || ''} > {getFieldDecorator('password', { rules: [ { required: true, message: '请输入密码' }, { min: 8, message: '密码长度不小于 8 位' }, { validator: this.validateToNextPassword }, ], })( <Input type="password" placeholder="请输入密码" onBlur={this.handleConfirmBlur} autoComplete="off" />, )} </FormItem>
validateToNextPassword = (rule, value, callback) => { clearTimeout(this.state.queue); this.setState({ queue: setTimeout(() => { const form = this.props.form; if (value && this.state.confirmDirty) { form.validateFields(['confirmPassword'], { force: true }); } callback(); }, 900), }); }
Is there a method for deplay in input ?(delay monitoring)
You can set validateTrigger to onBlur : )
validateTrigger
onBlur
Current solution
Is there a method for deplay in input ?(delay monitoring)