2
0
mirror of https://github.com/tenrok/vue-form-wizard.git synced 2026-06-01 15:14:03 +03:00

#12 Do not validate an previous step

This commit is contained in:
cristijora
2017-06-07 22:59:36 +03:00
parent a67fc7bc93
commit 45306e301d
3 changed files with 9 additions and 8 deletions
+4 -4
View File
@@ -9,7 +9,7 @@
@on-loading="setLoading"
@on-error="setError"
class="card" ref="wizard">
<tab-content title="1" icon="ti-settings">
<tab-content title="1" icon="ti-settings" :before-change="validateAsync">
First tab
</tab-content>
<tab-content title="2" icon="ti-settings" :before-change="validateAsync">
@@ -52,13 +52,13 @@
//simulating an error for the first time and a success for the second time
return new Promise((resolve, reject) => {
setTimeout(() => {
if (this.count < 1) {
this.count ++
if (this.count % 2 === 0) {
reject('Some custom error')
} else {
resolve(true)
}
}, 1000)
this.count ++
}, 100)
})
},
validate () {