Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit dda2165

Browse files
committed
#40 Support sync modifier for start-index
1 parent 98ec2f5 commit dda2165

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/FormWizard.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@
203203
}
204204
},
205205
methods: {
206+
emitTabChange (prevIndex, nextIndex) {
207+
this.$emit('on-change', prevIndex, nextIndex)
208+
this.$emit('update:startIndex', nextIndex)
209+
},
206210
addTab (item) {
207211
const index = this.$slots.default.indexOf(item.$vnode)
208212
this.tabs.splice(index, 0, item)
@@ -224,7 +228,7 @@
224228
if (index < this.activeTabIndex) {
225229
this.maxStep = this.activeTabIndex - 1
226230
this.activeTabIndex = this.activeTabIndex - 1
227-
this.$emit('on-change', this.activeTabIndex + 1, this.activeTabIndex)
231+
this.emitTabChange(this.activeTabIndex + 1, this.activeTabIndex)
228232
}
229233
tabs.splice(index, 1)
230234
}
@@ -331,7 +335,7 @@
331335
newTab.active = true
332336
}
333337
if (emitChangeEvent && this.activeTabIndex !== newIndex) {
334-
this.$emit('on-change', oldIndex, newIndex)
338+
this.emitTabChange(oldIndex, newIndex)
335339
}
336340
this.activeTabIndex = newIndex
337341
this.activateTabAndCheckStep(this.activeTabIndex)

0 commit comments

Comments
 (0)