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'
4
4
import { isIE9 } from 'web/util/index'
5
5
import { cached , extend } from 'shared/util'
6
6
import { mergeVNodeHook } from 'core/vdom/helpers'
7
+ import { activeInstance } from 'core/instance/lifecycle'
7
8
import {
8
9
nextFrame ,
9
10
addTransitionClass ,
@@ -47,8 +48,17 @@ export function enter (vnode: VNodeWithData) {
47
48
appearCancelled
48
49
} = data
49
50
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
+
51
60
const isAppear = ! context . _isMounted || ! vnode . isRootInsert
61
+
52
62
if ( isAppear && ! appear && appear !== '' ) {
53
63
return
54
64
}
You can’t perform that action at this time.
0 commit comments