mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-25 09:30:33 +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)
|
this.beforeTabChange(this.activeTabIndex, cb)
|
||||||
} else {
|
} else {
|
||||||
this.changeTab(this.activeTabIndex, index)
|
this.changeTab(this.activeTabIndex, index)
|
||||||
|
this.afterTabChange(this.activeTabIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (validate) {
|
if (validate) {
|
||||||
@@ -295,6 +296,7 @@
|
|||||||
let cb = () => {
|
let cb = () => {
|
||||||
if (this.activeTabIndex < this.tabCount - 1) {
|
if (this.activeTabIndex < this.tabCount - 1) {
|
||||||
this.changeTab(this.activeTabIndex, this.activeTabIndex + 1)
|
this.changeTab(this.activeTabIndex, this.activeTabIndex + 1)
|
||||||
|
this.afterTabChange(this.activeTabIndex)
|
||||||
} else {
|
} else {
|
||||||
this.$emit('on-complete')
|
this.$emit('on-complete')
|
||||||
}
|
}
|
||||||
@@ -377,6 +379,16 @@
|
|||||||
callback()
|
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) {
|
changeTab (oldIndex, newIndex, emitChangeEvent = true) {
|
||||||
let oldTab = this.tabs[oldIndex]
|
let oldTab = this.tabs[oldIndex]
|
||||||
let newTab = this.tabs[newIndex]
|
let newTab = this.tabs[newIndex]
|
||||||
|
|||||||
@@ -29,6 +29,13 @@
|
|||||||
*/
|
*/
|
||||||
beforeChange: {
|
beforeChange: {
|
||||||
type: Function
|
type: Function
|
||||||
|
},
|
||||||
|
/***
|
||||||
|
* Function to execute after tab switch. Return void for now.
|
||||||
|
* Safe to assume necessary validation has already occured
|
||||||
|
*/
|
||||||
|
afterChange: {
|
||||||
|
type: Function
|
||||||
},
|
},
|
||||||
route: {
|
route: {
|
||||||
type: [String, Object]
|
type: [String, Object]
|
||||||
|
|||||||
Reference in New Issue
Block a user