Merge pull request #437 from tengmaoqing/form-empty-fields

fix: 解决props为空,验证表单没响应的问题
This commit is contained in:
Aresn 2020-06-23 17:29:01 +08:00 committed by GitHub
commit 64772343f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -91,6 +91,13 @@
return new Promise(resolve => {
let valid = true;
let count = 0;
// fields promise
if (this.fields.length === 0) {
resolve(valid);
if (typeof callback === 'function') {
callback(valid);
}
}
this.fields.forEach(field => {
field.validate('', errors => {
if (errors) {