File tree Expand file tree Collapse file tree 5 files changed +16
-17
lines changed
platforms/web/runtime/components Expand file tree Collapse file tree 5 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,7 @@ declare interface VNodeData {
4444 staticAttrs ?: { [ key : string ] : string } ;
4545 hook ?: { [ key : string ] : Function } ;
4646 on ?: { [ key : string ] : Function | Array < Function > } ;
47- transition ?: {
48- definition : String | Object ,
49- appear : boolean
50- } ;
47+ transition ?: string | Object ;
5148 inlineTemplate ?: {
5249 render : Function ,
5350 staticRenderFns : Array < Function >
Original file line number Diff line number Diff line change 11import { callHook } from 'core/instance/lifecycle'
2+ import { getRealChild } from 'core/vdom/helpers'
23
34export default {
45 name : 'keep-alive' ,
@@ -30,14 +31,3 @@ export default {
3031 }
3132 }
3233}
33-
34- // in case the child is also an abstract component, e.g. <transition-control>
35- // we want to recrusively retrieve the real component to be rendered
36- function getRealChild ( vnode ) {
37- const compOptions = vnode && vnode . componentOptions
38- if ( compOptions && compOptions . Ctor . options . _abstract ) {
39- return getRealChild ( compOptions . propsData . child )
40- } else {
41- return vnode
42- }
43- }
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export function lifecycleMixin (Vue: Class<Component>) {
8686 vm . $el . __vue__ = vm
8787 }
8888 // update parent vnode element after patch
89- const parentNode = vm . $options . _parentVnode
89+ const parentNode = vm . $vnode
9090 if ( parentNode ) {
9191 parentNode . elm = vm . $el
9292 // update parent $el if the parent is HOC
Original file line number Diff line number Diff line change @@ -62,6 +62,17 @@ function applyNS (vnode, ns) {
6262 }
6363}
6464
65+ // in case the child is also an abstract component, e.g. <transition-control>
66+ // we want to recrusively retrieve the real component to be rendered
67+ export function getRealChild ( vnode ) {
68+ const compOptions = vnode && vnode . componentOptions
69+ if ( compOptions && compOptions . Ctor . options . _abstract ) {
70+ return getRealChild ( compOptions . propsData . child )
71+ } else {
72+ return vnode
73+ }
74+ }
75+
6576export function updateListeners (
6677 on : Object ,
6778 oldOn : Object ,
Original file line number Diff line number Diff line change 11/* flow */
22
33import { warn } from 'core/util/index'
4+ import { getRealChild } from 'core/vdom/helpers'
45
56export default {
67 name : 'transition-control' ,
@@ -20,7 +21,7 @@ export default {
2021 } ,
2122 render ( ) {
2223 const oldChild = this . _vnode
23- const newChild = this . child
24+ const newChild = getRealChild ( this . child )
2425 if ( oldChild && oldChild . data && (
2526 oldChild . tag !== newChild . tag ||
2627 oldChild . key !== newChild . key
You can’t perform that action at this time.
0 commit comments