This commit is contained in:
梁灏 2017-09-13 15:06:02 +08:00
parent 7b3d5ec124
commit bdfab3b99e
2 changed files with 85 additions and 60 deletions

View file

@ -150,7 +150,7 @@
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(tab.offsetWidth);
this.barWidth = tab ? parseFloat(tab.offsetWidth) : 0;
if (index > 0) {
let offset = 0;