mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-23 06:40:32 +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
|
let validate = index > this.activeTabIndex
|
||||||
if (index <= this.maxStep) {
|
if (index <= this.maxStep) {
|
||||||
let cb = () => {
|
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) {
|
if (validate) {
|
||||||
this.beforeTabChange(this.activeTabIndex, cb)
|
this.beforeTabChange(this.activeTabIndex, cb)
|
||||||
|
|||||||
Reference in New Issue
Block a user