mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-04-25 17:14:49 +00:00
Merge pull request #797 from pedro-meza/bugfix/dynamic-mdTabs
Bugfix/dynamic md tabs
This commit is contained in:
commit
7183b253d5
1 changed files with 13 additions and 0 deletions
|
|
@ -126,7 +126,20 @@
|
|||
};
|
||||
},
|
||||
registerTab(tabData) {
|
||||
let hasActive = false;
|
||||
|
||||
for (let tab of Object.keys(this.tabList)) {
|
||||
if (this.tabList[tab].active) {
|
||||
hasActive = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.$set(this.tabList, tabData.id, tabData);
|
||||
|
||||
if (!hasActive) {
|
||||
this.tabList[tabData.id].active = true;
|
||||
}
|
||||
},
|
||||
unregisterTab(tabData) {
|
||||
this.$delete(this.tabList, tabData.id);
|
||||
|
|
|
|||
Loading…
Reference in a new issue