Commit 3ce6b446d3793caf9f3e1885ccb78c2e740b84a3
1 parent
82278172
Use visibility instead of display
Showing
1 changed file
with
4 additions
and
8 deletions
Show diff stats
src/components/tabs/tabs.vue
| @@ -146,7 +146,7 @@ | @@ -146,7 +146,7 @@ | ||
| 146 | }, | 146 | }, |
| 147 | barStyle () { | 147 | barStyle () { |
| 148 | let style = { | 148 | let style = { |
| 149 | - display: 'none', | 149 | + visibility: 'hidden', |
| 150 | width: `${this.barWidth}px` | 150 | width: `${this.barWidth}px` |
| 151 | }; | 151 | }; |
| 152 | if (this.type === 'line') style.display = 'block'; | 152 | if (this.type === 'line') style.display = 'block'; |
| @@ -388,14 +388,10 @@ | @@ -388,14 +388,10 @@ | ||
| 388 | const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0); | 388 | const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0); |
| 389 | [...this.$refs.panes.children].forEach((el, i) => { | 389 | [...this.$refs.panes.children].forEach((el, i) => { |
| 390 | if (nextIndex === i) { | 390 | if (nextIndex === i) { |
| 391 | - [...el.children].forEach(child => child.style.display = 'block'); | ||
| 392 | - setTimeout(() => { | ||
| 393 | - focusFirst(el, el); | ||
| 394 | - }, transitionTime); | 391 | + [...el.children].forEach(child => child.style.visibility = 'visible'); |
| 392 | + setTimeout(() => focusFirst(el, el), transitionTime); | ||
| 395 | } else { | 393 | } else { |
| 396 | - setTimeout(() => { | ||
| 397 | - [...el.children].forEach(child => child.style.display = 'none'); | ||
| 398 | - }, transitionTime); | 394 | + [...el.children].forEach(child => child.style.visibility = 'hidden'); |
| 399 | } | 395 | } |
| 400 | }); | 396 | }); |
| 401 | } | 397 | } |