Revert "fix form validate callback params" (#1864)

This reverts commit 87b13bf0e0.
pull/1876/head
baiyaaaaa 2016-12-20 14:17:53 +08:00 committed by cinwell.li
parent 3a14efeed0
commit 1db8dc6588
3 changed files with 10 additions and 10 deletions

View File

@ -809,10 +809,10 @@ Form component allows you to verify your data, helping you find and correct erro
### Form Methods ### Form Methods
| Method | Description | params | Method | Description |
| ---- | ---- | ---- | ---- | ---- |
| validate | the method to validate the whole form | Function(callback: Function(boolean)) | validate(cb) | the method to validate the whole form |
| validateField | the method to validate a certain form item | Function(prop: string, callback: Function(errorMessage: string)) | validateField(prop, cb) | the method to validate a certain form item |
| resetFields | reset all the fields and remove validation result | | resetFields | reset all the fields and remove validation result |
### Form-Item Attributes ### Form-Item Attributes

View File

@ -799,11 +799,11 @@
### Form Methods ### Form Methods
| 方法名 | 说明 | 参数 | 方法名 | 说明 |
|---------- |-------------- | -------------- |---------- |-------------- |
| validate | 对整个表单进行校验的方法 | Function(callback: Function(boolean)) | validate(cb) | 对整个表单进行校验的方法 |
| validateField | 对部分表单字段进行校验的方法 | Function(prop: string, callback: Function(errorMessage: string)) | validateField(prop, cb) | 对部分表单字段进行校验的方法 |
| resetFields | 对整个表单进行重置,将所有字段值重置为空并移除校验结果 | - | resetFields | 对整个表单进行重置,将所有字段值重置为空并移除校验结果 |
### Form-Item Attributes ### Form-Item Attributes

View File

@ -139,7 +139,7 @@
this.validateState = !errors ? 'success' : 'error'; this.validateState = !errors ? 'success' : 'error';
this.validateMessage = errors ? errors[0].message : ''; this.validateMessage = errors ? errors[0].message : '';
callback(this.validateMessage); callback(errors);
}); });
}, },
resetField() { resetField() {