fix undefined object.values method and emit @change event (#167)

* [fix] Object.values() not supported in IE/Safari #165  

* [fix] mdTabs emit change event #168 

* change var to let
This commit is contained in:
Jérémy TOUZY 2016-12-07 21:48:33 +01:00 committed by Marcos Moura
parent de4efeac7e
commit e8c83d0491

View file

@ -152,10 +152,15 @@
this.contentWidth = width * this.activeTabNumber + 'px';
Object.values(this.tabList).forEach((tab, index) => {
let index = 0;
for (const tabId in this.tabList) {
let tab = this.tabList[tabId];
tab.ref.width = width + 'px';
tab.ref.left = width * index + 'px';
});
index++;
}
},
calculateContentHeight() {
this.$nextTick(() => {
@ -189,6 +194,7 @@
this.activeTab = tabData.id;
this.activeTabNumber = this.getTabIndex(this.activeTab);
this.calculatePosition();
this.$emit('change', this.activeTabNumber);
}
},
mounted() {