mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-19 22:20:32 +03:00
added afterTabChange functionality
This commit is contained in:
Generated
+11185
File diff suppressed because it is too large
Load Diff
@@ -280,6 +280,7 @@
|
||||
this.beforeTabChange(this.activeTabIndex, cb)
|
||||
} else {
|
||||
this.changeTab(this.activeTabIndex, index)
|
||||
this.afterTabChange(this.activeTabIndex)
|
||||
}
|
||||
}
|
||||
if (validate) {
|
||||
@@ -295,6 +296,7 @@
|
||||
let cb = () => {
|
||||
if (this.activeTabIndex < this.tabCount - 1) {
|
||||
this.changeTab(this.activeTabIndex, this.activeTabIndex + 1)
|
||||
this.afterTabChange(this.activeTabIndex)
|
||||
} else {
|
||||
this.$emit('on-complete')
|
||||
}
|
||||
@@ -377,6 +379,16 @@
|
||||
callback()
|
||||
}
|
||||
},
|
||||
afterTabChange (index) {
|
||||
console.log('aftertabchange')
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
let newTab = this.tabs[index]
|
||||
if (newTab && newTab.afterTabChange !== undefined) {
|
||||
newTab.afterTabChange()
|
||||
}
|
||||
},
|
||||
changeTab (oldIndex, newIndex, emitChangeEvent = true) {
|
||||
let oldTab = this.tabs[oldIndex]
|
||||
let newTab = this.tabs[newIndex]
|
||||
|
||||
@@ -29,6 +29,13 @@
|
||||
*/
|
||||
beforeChange: {
|
||||
type: Function
|
||||
},
|
||||
/***
|
||||
* Function to execute after tab switch. Return void for now.
|
||||
* Safe to assume necessary validation has already occured
|
||||
*/
|
||||
afterChange: {
|
||||
type: Function
|
||||
},
|
||||
route: {
|
||||
type: [String, Object]
|
||||
|
||||
Reference in New Issue
Block a user