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

Allow for non tab-content items in default slot #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/FormWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@
this.$emit('update:startIndex', nextIndex)
},
addTab (item) {
const index = this.$slots.default.indexOf(item.$vnode)
// Index should only be relative to TabContent
const index = this.$slots.default.filter((slotItem) => slotItem.elm.classList && slotItem.elm.classList.contains('wizard-tab-container')).indexOf(item.$vnode)
item.tabId = `${item.title.replace(/ /g, '')}${index}`
this.tabs.splice(index, 0, item)
// if a step is added before the current one, go to it
Expand Down