Form: 如果需要验证的fields为空,调用验证时立刻返回callback (#3944)

* Form: 如果需要验证的fields为空,调用验证时立刻返回callback
同时修复几个代码格式用来通过npm run dist

* fix travis

* fix travis

* fix travis
pull/3950/head
sunlei33 2017-04-01 14:06:23 +08:00 committed by baiyaaaaa
parent 81ba7084e3
commit 5eef48b97e
4 changed files with 10 additions and 3 deletions

View File

@ -59,6 +59,10 @@
validate(callback) { validate(callback) {
let valid = true; let valid = true;
let count = 0; let count = 0;
// fieldscallback
if (this.fields.length === 0 && callback) {
callback(true);
}
this.fields.forEach((field, index) => { this.fields.forEach((field, index) => {
field.validate('', errors => { field.validate('', errors => {
if (errors) { if (errors) {

View File

@ -158,4 +158,5 @@
} }
} }
}; };
</script> </script>

View File

@ -172,4 +172,5 @@
); );
} }
}; };
</script> </script>

View File

@ -27,4 +27,5 @@
} }
} }
}; };
</script> </script>