Permalink
Browse files

fix(tab): fix the delay in tab transition (#1812) (#1806)

  • Loading branch information...
rinick authored and pi0 committed May 17, 2018
1 parent 42175f8 commit 5a7a29002f3140162e597c76d98c0101a9ca3949
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/components/tabs/tab.js
@@ -28,21 +28,19 @@ export default {
props: { mode: 'out-in' },
on: {
beforeEnter: this.beforeEnter,
afterEnter: this.afterEnter,
afterLeave: this.afterLeave
beforeLeave: this.beforeLeave
}
},
[content]
)
},
methods: {
beforeEnter () {
this.show = false
},
afterEnter () {
this.show = true
// change opacity 1 frame after display
// otherwise css transition won't happen
window.requestAnimationFrame(() => { this.show = true })
},
afterLeave () {
beforeLeave () {
this.show = false
}
},

0 comments on commit 5a7a290

Please sign in to comment.