Преглед на файлове

fix getReadlChild types

Evan You преди 9 години
родител
ревизия
b6d386b070
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/core/vdom/helpers.js

+ 2 - 2
src/core/vdom/helpers.js

@@ -64,10 +64,10 @@ function applyNS (vnode, ns) {
 
 
 // in case the child is also an abstract component, e.g. <transition-control>
 // in case the child is also an abstract component, e.g. <transition-control>
 // we want to recrusively retrieve the real component to be rendered
 // we want to recrusively retrieve the real component to be rendered
-export function getRealChild (vnode) {
+export function getRealChild (vnode: ?VNode): ?VNode {
   const compOptions = vnode && vnode.componentOptions
   const compOptions = vnode && vnode.componentOptions
   if (compOptions && compOptions.Ctor.options._abstract) {
   if (compOptions && compOptions.Ctor.options._abstract) {
-    return getRealChild(compOptions.propsData.child)
+    return getRealChild(compOptions.propsData && compOptions.propsData.child)
   } else {
   } else {
     return vnode
     return vnode
   }
   }