From 662a4090564a52a61bfe88e954be8915cb783a82 Mon Sep 17 00:00:00 2001 From: Pim Date: Wed, 21 Aug 2019 13:36:52 +0200 Subject: [PATCH] fix(vue-app): only overwrite leave listener when none provided or without done arg (#6264) --- .../vue-app/template/components/nuxt-child.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/vue-app/template/components/nuxt-child.js b/packages/vue-app/template/components/nuxt-child.js index 7754a9a650..796ec17edd 100644 --- a/packages/vue-app/template/components/nuxt-child.js +++ b/packages/vue-app/template/components/nuxt-child.js @@ -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) + } } }