File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/platforms/web/runtime/modules Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { inBrowser } from 'core/util/index'
44import { isIE9 } from 'web/util/index'
55import { cached , extend } from 'shared/util'
66import { mergeVNodeHook } from 'core/vdom/helpers'
7+ import { activeInstance } from 'core/instance/lifecycle'
78import {
89 nextFrame ,
910 addTransitionClass ,
@@ -47,8 +48,17 @@ export function enter (vnode: VNodeWithData) {
4748 appearCancelled
4849 } = data
4950
50- const context = vnode . context . $parent || vnode . context
51+ // activeInstance will always be the <transition> component managing this
52+ // transition. One edge case to check is when the <transition> is placed
53+ // as the root node of a child component. In that case we need to check
54+ // <transition>'s parent for appear check.
55+ const transitionNode = activeInstance . $vnode
56+ const context = transitionNode && transitionNode . parent
57+ ? transitionNode . parent . context
58+ : activeInstance
59+
5160 const isAppear = ! context . _isMounted || ! vnode . isRootInsert
61+
5262 if ( isAppear && ! appear && appear !== '' ) {
5363 return
5464 }
You can’t perform that action at this time.
0 commit comments