@@ -51,10 +51,12 @@ export function enter (vnode: VNodeWithData) {
5151 // transition. One edge case to check is when the <transition> is placed
5252 // as the root node of a child component. In that case we need to check
5353 // <transition>'s parent for appear check.
54- const transitionNode = activeInstance . $vnode
55- const context = transitionNode && transitionNode . parent
56- ? transitionNode . parent . context
57- : activeInstance
54+ let context = activeInstance
55+ let transitionNode = activeInstance . $vnode
56+ while ( transitionNode && transitionNode . parent ) {
57+ transitionNode = transitionNode . parent
58+ context = transitionNode . context
59+ }
5860
5961 const isAppear = ! context . _isMounted || ! vnode . isRootInsert
6062
@@ -96,7 +98,10 @@ export function enter (vnode: VNodeWithData) {
9698 mergeVNodeHook ( vnode . data . hook || ( vnode . data . hook = { } ) , 'insert' , ( ) => {
9799 const parent = el . parentNode
98100 const pendingNode = parent && parent . _pending && parent . _pending [ vnode . key ]
99- if ( pendingNode && pendingNode . tag === vnode . tag && pendingNode . elm . _leaveCb ) {
101+ if ( pendingNode &&
102+ pendingNode . context === vnode . context &&
103+ pendingNode . tag === vnode . tag &&
104+ pendingNode . elm . _leaveCb ) {
100105 pendingNode . elm . _leaveCb ( )
101106 }
102107 enterHook && enterHook ( el , cb )
0 commit comments