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

Commit

Permalink
#40 Support sync modifier for start-index
Browse files Browse the repository at this point in the history
  • Loading branch information
cristijora committed Sep 4, 2017
1 parent 98ec2f5 commit dda2165
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/FormWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@
}
},
methods: {
emitTabChange (prevIndex, nextIndex) {
this.$emit('on-change', prevIndex, nextIndex)
this.$emit('update:startIndex', nextIndex)
},
addTab (item) {
const index = this.$slots.default.indexOf(item.$vnode)
this.tabs.splice(index, 0, item)
Expand All @@ -224,7 +228,7 @@
if (index < this.activeTabIndex) {
this.maxStep = this.activeTabIndex - 1
this.activeTabIndex = this.activeTabIndex - 1
this.$emit('on-change', this.activeTabIndex + 1, this.activeTabIndex)
this.emitTabChange(this.activeTabIndex + 1, this.activeTabIndex)
}
tabs.splice(index, 1)
}
Expand Down Expand Up @@ -331,7 +335,7 @@
newTab.active = true
}
if (emitChangeEvent && this.activeTabIndex !== newIndex) {
this.$emit('on-change', oldIndex, newIndex)
this.emitTabChange(oldIndex, newIndex)
}
this.activeTabIndex = newIndex
this.activateTabAndCheckStep(this.activeTabIndex)
Expand Down

0 comments on commit dda2165

Please sign in to comment.