mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
fix(vue-app): only overwrite leave listener when none provided or without done arg (#6264)
This commit is contained in:
parent
3ca7eca7cf
commit
662a409056
@ -56,6 +56,10 @@ export default {
|
|||||||
// make sure that leave is called asynchronous (fix #5703)
|
// make sure that leave is called asynchronous (fix #5703)
|
||||||
if (transition.css === false) {
|
if (transition.css === false) {
|
||||||
const leave = listeners.leave
|
const leave = listeners.leave
|
||||||
|
|
||||||
|
// only add leave listener when user didnt provide one
|
||||||
|
// or when it misses the done argument
|
||||||
|
if (!leave || leave.length < 2) {
|
||||||
listeners.leave = (el, done) => {
|
listeners.leave = (el, done) => {
|
||||||
if (leave) {
|
if (leave) {
|
||||||
leave.call(_parent, el)
|
leave.call(_parent, el)
|
||||||
@ -64,6 +68,7 @@ export default {
|
|||||||
_parent.$nextTick(done)
|
_parent.$nextTick(done)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let routerView = h('routerView', data)
|
let routerView = h('routerView', data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user