diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index dcc1d639..372ccc56 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -150,13 +150,13 @@ const index = this.navList.findIndex((nav) => nav.name === this.activeKey); const prevTabs = this.$refs.nav.querySelectorAll(`.${prefixCls}-tab`); const tab = prevTabs[index]; - this.barWidth = parseFloat(getStyle(tab, 'width')); + this.barWidth = parseFloat(tab.offsetWidth); if (index > 0) { let offset = 0; const gutter = this.size === 'small' ? 0 : 16; for (let i = 0; i < index; i++) { - offset += parseFloat(getStyle(prevTabs[i], 'width')) + gutter; + offset += parseFloat(prevTabs[i].offsetWidth) + gutter; } this.barOffset = offset;