update Tab

This commit is contained in:
梁灏 2017-10-26 11:26:05 +08:00
parent af7d72b4cc
commit 2993f4eec3
2 changed files with 245 additions and 52 deletions

View file

@ -155,6 +155,7 @@
updateBar () {
this.$nextTick(() => {
const index = this.navList.findIndex((nav) => nav.name === this.activeKey);
if (!this.$refs.nav) return; // #2100
const prevTabs = this.$refs.nav.querySelectorAll(`.${prefixCls}-tab`);
const tab = prevTabs[index];
this.barWidth = tab ? parseFloat(tab.offsetWidth) : 0;