2
0
mirror of https://github.com/tenrok/vue-form-wizard.git synced 2026-06-10 09:02:24 +03:00

#12 Remove validations when going to a previous tab

Clear validation error upon tab navigation
This commit is contained in:
cristijora
2017-06-07 22:45:14 +03:00
parent 2f8dc613a5
commit a67fc7bc93
3 changed files with 11 additions and 4 deletions
+2 -1
View File
@@ -13,7 +13,7 @@
</div>
<ul class="wizard-nav wizard-nav-pills">
<li v-for="(tab, index) in tabs" :class="{active:tab.active}">
<a href="" @click.prevent="navigateToTab(index)">
<a href="" @click.prevent="navigateToTab(index, false)">
<div class="wizard-icon-circle"
:class="{checked:isChecked(index),square_shape:isStepSquare, tab_shape:isTabShape}"
:style="[isChecked(index)? stepCheckedStyle : {}, tab.validationError ? errorStyle : {}]">
@@ -224,6 +224,7 @@
navigateToTab (index, validate = true) {
if (index <= this.maxStep) {
let cb = () => {
this.setValidationError(null)
this.changeTab(this.activeTabIndex, index)
}
if (validate) {