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

Form: Fixed validation issue with dynamic rules (issue #1317)
pull/1393/head
baiyaaaaa 2016-11-27 11:51:37 +08:00 committed by GitHub
commit 58098f5693
1 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,11 @@
}, },
inline: Boolean inline: Boolean
}, },
watch: {
rules() {
this.validate();
}
},
data() { data() {
return { return {
fields: [] fields: []
@ -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);
} }
}); });