mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-11 07:32:24 +03:00
Fix start-index issue
This commit is contained in:
@@ -16,17 +16,6 @@
|
||||
<tab-content v-for="tab in tabs" :title="tab" :key="tab" icon="ti-settings">
|
||||
{{tab}}
|
||||
</tab-content>
|
||||
<tab-content title="Additional Info"
|
||||
:before-change="validateAsync"
|
||||
icon="ti-settings">
|
||||
Additional info
|
||||
</tab-content>
|
||||
<tab-content title="Last step"
|
||||
icon="ti-check">
|
||||
</tab-content>
|
||||
<transition name="fade" mode="out-in">
|
||||
<router-view></router-view>
|
||||
</transition>
|
||||
<div class="loader" v-if="loadingWizard"></div>
|
||||
<div v-if="error">
|
||||
{{error}}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -224,6 +224,7 @@
|
||||
this.tabs.splice(index, 0, item)
|
||||
// if a step is added before the current one, go to it
|
||||
if (index < this.activeTabIndex + 1) {
|
||||
console.log('Changing tabs', index, this.activeTabIndex)
|
||||
this.maxStep = index
|
||||
this.changeTab(this.activeTabIndex + 1, index)
|
||||
}
|
||||
@@ -237,6 +238,10 @@
|
||||
this.maxStep = this.activeTabIndex - 1
|
||||
this.changeTab(this.activeTabIndex, this.activeTabIndex - 1)
|
||||
}
|
||||
if (index < this.activeTabIndex) {
|
||||
this.maxStep = this.activeTabIndex - 1
|
||||
this.activeTabIndex = this.activeTabIndex - 1
|
||||
}
|
||||
tabs.splice(index, 1)
|
||||
}
|
||||
},
|
||||
@@ -385,14 +390,13 @@
|
||||
this.navigateToTab(matchingTabIndex, shouldValidate)
|
||||
}
|
||||
},
|
||||
getTabs () {
|
||||
let tabs = this.$slots.default.filter((comp) => comp.componentOptions && comp.componentOptions.tag === 'tab-content')
|
||||
.map(comp => {
|
||||
return comp.componentInstance
|
||||
})
|
||||
return tabs
|
||||
deactivateTabs () {
|
||||
this.tabs.forEach(tab => {
|
||||
tab.active = false
|
||||
})
|
||||
},
|
||||
activateTab (index) {
|
||||
this.deactivateTabs()
|
||||
let tab = this.tabs[index]
|
||||
tab.active = true
|
||||
this.tryChangeRoute(tab)
|
||||
|
||||
Reference in New Issue
Block a user