From 3ce6b446d3793caf9f3e1885ccb78c2e740b84a3 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Fri, 18 May 2018 15:24:49 +0200 Subject: [PATCH 1/2] Use visibility instead of display --- src/components/tabs/tabs.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index 0a267403..294dbfc8 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -146,7 +146,7 @@ }, barStyle () { let style = { - display: 'none', + visibility: 'hidden', width: `${this.barWidth}px` }; if (this.type === 'line') style.display = 'block'; @@ -388,14 +388,10 @@ const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0); [...this.$refs.panes.children].forEach((el, i) => { if (nextIndex === i) { - [...el.children].forEach(child => child.style.display = 'block'); - setTimeout(() => { - focusFirst(el, el); - }, transitionTime); + [...el.children].forEach(child => child.style.visibility = 'visible'); + setTimeout(() => focusFirst(el, el), transitionTime); } else { - setTimeout(() => { - [...el.children].forEach(child => child.style.display = 'none'); - }, transitionTime); + [...el.children].forEach(child => child.style.visibility = 'hidden'); } }); } From e906d57094da5c7e3a52fe491bbe8e51bc9b262b Mon Sep 17 00:00:00 2001 From: Aresn Date: Mon, 21 May 2018 10:51:23 +0800 Subject: [PATCH 2/2] Update tabs.vue --- src/components/tabs/tabs.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index 294dbfc8..e3d156a6 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -149,7 +149,7 @@ visibility: 'hidden', width: `${this.barWidth}px` }; - if (this.type === 'line') style.display = 'block'; + if (this.type === 'line') style.visibility = 'visible'; if (this.animated) { style.transform = `translate3d(${this.barOffset}px, 0px, 0px)`; } else {