From 582a8932d3933517b36c9b1d499f9ddeba145fbf Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 13 Jul 2016 12:36:06 -0400 Subject: [PATCH] really fix out-in mode --- src/platforms/web/runtime/components/transition.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/platforms/web/runtime/components/transition.js b/src/platforms/web/runtime/components/transition.js index 6f3b6031..6d746ace 100644 --- a/src/platforms/web/runtime/components/transition.js +++ b/src/platforms/web/runtime/components/transition.js @@ -60,15 +60,18 @@ export default { const oldChild = getRealChild(oldRawChild) if (mode && oldChild && oldChild.data && oldChild.key !== child.key) { if (mode === 'out-in') { - // return old node - // and queue an update when the leave finishes - if (!oldChild.elm._leaveCb && oldRawChild.data.transition) { + if ( + !oldChild.elm._leaveCb && // not already leaving + oldChild.data.transition // not already left + ) { leave(oldChild, () => { - oldRawChild.data.transition = null + // mark left & avoid triggering leave transition again + oldChild.data.transition = null this.$forceUpdate() }) } - if (oldRawChild.data.transition) { + // return old node if not left yet + if (oldChild.data.transition) { return oldRawChild } } else if (mode === 'in-out') {