Commit 58098f56 authored by baiyaaaaa's avatar baiyaaaaa Committed by GitHub

Merge pull request #1384 from HashemQolami/fix-form-validation

Form: Fixed validation issue with dynamic rules (issue #1317)
parents 09099557 bfab5cd9
...@@ -23,6 +23,11 @@ ...@@ -23,6 +23,11 @@
}, },
inline: Boolean inline: Boolean
}, },
watch: {
rules() {
this.validate();
}
},
data() { data() {
return { return {
fields: [] fields: []
...@@ -54,7 +59,7 @@ ...@@ -54,7 +59,7 @@
if (errors) { if (errors) {
valid = false; valid = false;
} }
if (index === this.fields.length - 1) { if (typeof callback === 'function' && index === this.fields.length - 1) {
callback(valid); callback(valid);
} }
}); });
......
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