mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
fix(vue-app): always finish transition.leave
asynchronously (#5891)
This commit is contained in:
parent
835611f78d
commit
2a2bf9b93d
@ -48,21 +48,33 @@ export default {
|
|||||||
window.<%= globals.nuxt %>.$nextTick(() => {
|
window.<%= globals.nuxt %>.$nextTick(() => {
|
||||||
window.<%= globals.nuxt %>.$emit('triggerScroll')
|
window.<%= globals.nuxt %>.$emit('triggerScroll')
|
||||||
})
|
})
|
||||||
if (beforeEnter) return beforeEnter.call(_parent, el)
|
if (beforeEnter) {
|
||||||
|
return beforeEnter.call(_parent, el)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let routerView = [
|
// make sure that leave is called asynchronous (fix #5703)
|
||||||
h('router-view', data)
|
if (transition.css === false) {
|
||||||
]
|
const leave = listeners.leave
|
||||||
if (props.keepAlive) {
|
listeners.leave = (el, done) => {
|
||||||
routerView = [
|
if (leave) {
|
||||||
h('keep-alive', { props: props.keepAliveProps }, routerView)
|
leave.call(_parent, el)
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_parent.$nextTick(done)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let routerView = h('routerView', data)
|
||||||
|
|
||||||
|
if (props.keepAlive) {
|
||||||
|
routerView = h('keep-alive', { props: props.keepAliveProps }, [routerView])
|
||||||
|
}
|
||||||
|
|
||||||
return h('transition', {
|
return h('transition', {
|
||||||
props: transitionProps,
|
props: transitionProps,
|
||||||
on: listeners
|
on: listeners
|
||||||
}, routerView)
|
}, [routerView])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user