Skip to content

Commit

Permalink
fix(routerpage): assign metadata change to correct tab (closes #135)
Browse files Browse the repository at this point in the history
When the `routeTab` property of a background tab changed the new metadata was always assigned to the
currently active tab instead. See #135

fix #135
  • Loading branch information
ithil authored and bhuh12 committed Dec 9, 2021
1 parent d969248 commit ff017a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mixins/routerPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ export default {
if (!val) return

const tab = typeof val === 'string' ? { title: val } : val
const { activeTab } = this.$tabs || emptyObj
const changedTabKey = this.$vnode.data.key
const changedTab =
this.$tabs.items.find(item => item.id == changedTabKey) || emptyObj

if (tab && activeTab) {
if (tab && changedTab) {
for (const key in tab) {
if (!['id', 'to'].includes(key)) {
this.$set(activeTab, key, tab[key])
this.$set(changedTab, key, tab[key])
}
}
}
Expand Down

0 comments on commit ff017a4

Please sign in to comment.