mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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,12 +56,17 @@ export default {
|
||||
// make sure that leave is called asynchronous (fix #5703)
|
||||
if (transition.css === false) {
|
||||
const leave = listeners.leave
|
||||
listeners.leave = (el, done) => {
|
||||
if (leave) {
|
||||
leave.call(_parent, el)
|
||||
}
|
||||
|
||||
_parent.$nextTick(done)
|
||||
// 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) => {
|
||||
if (leave) {
|
||||
leave.call(_parent, el)
|
||||
}
|
||||
|
||||
_parent.$nextTick(done)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user