From 899b8abb1a3c9df86803ecae99a88eab9a9d36ff Mon Sep 17 00:00:00 2001 From: cristijora Date: Mon, 28 Aug 2017 19:27:45 +0300 Subject: [PATCH] #37 Validate all steps when going more than one step --- src/components/FormWizard.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/FormWizard.vue b/src/components/FormWizard.vue index 00b8282..cd15108 100644 --- a/src/components/FormWizard.vue +++ b/src/components/FormWizard.vue @@ -219,7 +219,13 @@ let validate = index > this.activeTabIndex if (index <= this.maxStep) { let cb = () => { - this.changeTab(this.activeTabIndex, index) + if (validate && index - this.activeTabIndex > 1) { + // validate all steps recursively until destination index + this.changeTab(this.activeTabIndex, this.activeTabIndex + 1) + this.beforeTabChange(this.activeTabIndex, cb) + } else { + this.changeTab(this.activeTabIndex, index) + } } if (validate) { this.beforeTabChange(this.activeTabIndex, cb)