@@ -37,6 +37,7 @@ export function renderElement (
3737 // make sure to expose real self instead of proxy
3838 const context : Component = this . _self
3939 const parent : ?Component = renderState . activeInstance
40+ const host = context !== parent ? parent : undefined
4041 if ( ! parent ) {
4142 process . env . NODE_ENV !== 'production' && warn (
4243 'createElement cannot be called outside of component ' +
@@ -53,10 +54,10 @@ export function renderElement (
5354 if ( config . isReservedTag ( tag ) ) {
5455 return new VNode (
5556 tag , data , undefined ,
56- undefined , undefined , namespace , context
57+ undefined , undefined , namespace , context , host
5758 )
5859 } else if ( ( Ctor = resolveAsset ( context . $options , 'components' , tag ) ) ) {
59- return createComponent ( Ctor , data , parent , context , tag )
60+ return createComponent ( Ctor , data , parent , context , host , tag )
6061 } else {
6162 if ( process . env . NODE_ENV !== 'production' ) {
6263 if ( ! namespace && config . isUnknownElement ( tag ) ) {
@@ -69,11 +70,11 @@ export function renderElement (
6970 }
7071 return new VNode (
7172 tag , data , undefined ,
72- undefined , undefined , namespace , context
73+ undefined , undefined , namespace , context , host
7374 )
7475 }
7576 } else {
76- return createComponent ( tag , data , parent , context )
77+ return createComponent ( tag , data , parent , context , host )
7778 }
7879}
7980
@@ -82,5 +83,9 @@ export function renderText (str?: string): string {
8283}
8384
8485export function renderStatic ( index ?: number ) : Object | void {
85- return this . _staticTrees [ index ]
86+ return this . _staticTrees [ index ] || (
87+ this . _staticTrees [ index ] = this . $options . staticRenderFns [ index ] . call (
88+ this . _renderProxy
89+ )
90+ )
8691}
0 commit comments