From bfab5cd9edf01f5b4ec4b9cfdb1397cdd3c072f8 Mon Sep 17 00:00:00 2001 From: Hashem Qolami Date: Sat, 26 Nov 2016 16:28:43 +0330 Subject: [PATCH] Form: :wrench: fixed validation issue with dynamic rules (fixed #1317) --- packages/form/src/form.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/form/src/form.vue b/packages/form/src/form.vue index 7fecd646..b00634e4 100644 --- a/packages/form/src/form.vue +++ b/packages/form/src/form.vue @@ -23,6 +23,11 @@ }, inline: Boolean }, + watch: { + rules() { + this.validate(); + } + }, data() { return { fields: [] @@ -54,7 +59,7 @@ if (errors) { valid = false; } - if (index === this.fields.length - 1) { + if (typeof callback === 'function' && index === this.fields.length - 1) { callback(valid); } });