mirror of https://github.com/ElemeFE/element
fix valida field params bug
parent
5493a13523
commit
1df8c50dfb
|
@ -793,11 +793,11 @@
|
||||||
|
|
||||||
### Form Methods
|
### Form Methods
|
||||||
|
|
||||||
| 方法名 | 说明 |
|
| 方法名 | 说明 | 参数
|
||||||
|---------- |-------------- |
|
|---------- |-------------- | --------------
|
||||||
| validate(cb) | 对整个表单进行校验的方法 |
|
| validate | 对整个表单进行校验的方法 | Function(callback: Function(boolean))
|
||||||
| validateField(prop, cb) | 对部分表单字段进行校验的方法 |
|
| validateField | 对部分表单字段进行校验的方法 | Function(prop: string, callback: Function(errorMessage: string))
|
||||||
| resetFields | 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果 |
|
| resetFields | 对整个表单进行重置,将所有字段值重置为空并移除校验结果 | -
|
||||||
|
|
||||||
### Form-Item Attributes
|
### Form-Item Attributes
|
||||||
|
|
||||||
|
|
|
@ -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(errors);
|
callback(this.validateMessage);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
resetField() {
|
resetField() {
|
||||||
|
|
Loading…
Reference in New Issue