fix(vue-app): only overwrite leave listener when none provided or without done arg (#6264)

This commit is contained in:
Pim 2019-08-21 13:36:52 +02:00 committed by Pooya Parsa
parent 3ca7eca7cf
commit 662a409056

View File

@ -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)