Commit 5eef48b9 authored by sunlei33's avatar sunlei33 Committed by baiyaaaaa

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

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

* fix travis

* fix travis

* fix travis
parent 81ba7084
......@@ -59,6 +59,10 @@
validate(callback) {
let valid = true;
let count = 0;
// 如果需要验证的fields为空,调用验证时立刻返回callback
if (this.fields.length === 0 && callback) {
callback(true);
}
this.fields.forEach((field, index) => {
field.validate('', errors => {
if (errors) {
......
......@@ -159,3 +159,4 @@
}
};
</script>
......@@ -173,3 +173,4 @@
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment