mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-08 04:52:24 +03:00
#37 Validate all steps when going more than one step
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user