mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-03-16 22:10:27 +00:00
fixed bug causing error when mdTabs are registered from dynamic data #580
This commit is contained in:
parent
51289ab13e
commit
fe7c856eef
1 changed files with 16 additions and 0 deletions
|
|
@ -125,6 +125,22 @@
|
|||
'md-disabled': header.disabled
|
||||
};
|
||||
},
|
||||
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;
|
||||
}
|
||||
},
|
||||
registerTab(tabData) {
|
||||
this.$set(this.tabList, tabData.id, tabData);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue