File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 11declare type InternalComponentOptions = {
22 _isComponent : true ;
33 parent: Component ;
4- propsData: ?Object ;
54 _parentVnode: VNode ;
6- _parentListeners: ?Object ;
7- _renderChildren: ?Array < VNode > ;
8- _componentTag: ?string ;
95 _parentElm: ?Node ;
106 _refElm: ?Node ;
117 render ? : Function ;
Original file line number Diff line number Diff line change @@ -74,14 +74,18 @@ export function initMixin (Vue: Class<Component>) {
7474function initInternalComponent ( vm : Component , options : InternalComponentOptions ) {
7575 const opts = vm . $options = Object . create ( vm . constructor . options )
7676 // doing this because it's faster than dynamic enumeration.
77+ const parentVnode = options . _parentVnode
7778 opts . parent = options . parent
78- opts . propsData = options . propsData
79- opts . _parentVnode = options . _parentVnode
80- opts . _parentListeners = options . _parentListeners
81- opts . _renderChildren = options . _renderChildren
82- opts . _componentTag = options . _componentTag
79+ opts . _parentVnode = parentVnode
8380 opts . _parentElm = options . _parentElm
8481 opts . _refElm = options . _refElm
82+
83+ const vnodeComponentOptions = parentVnode . componentOptions
84+ opts . propsData = vnodeComponentOptions . propsData
85+ opts . _parentListeners = vnodeComponentOptions . listeners
86+ opts . _renderChildren = vnodeComponentOptions . children
87+ opts . _componentTag = vnodeComponentOptions . tag
88+
8589 if ( options . render ) {
8690 opts . render = options . render
8791 opts . staticRenderFns = options . staticRenderFns
Original file line number Diff line number Diff line change @@ -200,15 +200,10 @@ export function createComponentInstanceForVnode (
200200 parentElm ?: ?Node ,
201201 refElm ?: ?Node
202202) : Component {
203- const vnodeComponentOptions = vnode . componentOptions
204203 const options : InternalComponentOptions = {
205204 _isComponent : true ,
206205 parent,
207- propsData : vnodeComponentOptions . propsData ,
208- _componentTag : vnodeComponentOptions . tag ,
209206 _parentVnode : vnode ,
210- _parentListeners : vnodeComponentOptions . listeners ,
211- _renderChildren : vnodeComponentOptions . children ,
212207 _parentElm : parentElm || null ,
213208 _refElm : refElm || null
214209 }
@@ -218,7 +213,7 @@ export function createComponentInstanceForVnode (
218213 options . render = inlineTemplate . render
219214 options . staticRenderFns = inlineTemplate . staticRenderFns
220215 }
221- return new vnodeComponentOptions . Ctor ( options )
216+ return new vnode . componentOptions . Ctor ( options )
222217}
223218
224219function mergeHooks ( data : VNodeData ) {
You can’t perform that action at this time.
0 commit comments