File tree 3 files changed +10
-15
lines changed
3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 1
1
declare type InternalComponentOptions = {
2
2
_isComponent : true ;
3
3
parent: Component ;
4
- propsData: ?Object ;
5
4
_parentVnode: VNode ;
6
- _parentListeners: ?Object ;
7
- _renderChildren: ?Array < VNode > ;
8
- _componentTag: ?string ;
9
5
_parentElm: ?Node ;
10
6
_refElm: ?Node ;
11
7
render ? : Function ;
Original file line number Diff line number Diff line change @@ -74,14 +74,18 @@ export function initMixin (Vue: Class<Component>) {
74
74
function initInternalComponent ( vm : Component , options : InternalComponentOptions ) {
75
75
const opts = vm . $options = Object . create ( vm . constructor . options )
76
76
// doing this because it's faster than dynamic enumeration.
77
+ const parentVnode = options . _parentVnode
77
78
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
83
80
opts . _parentElm = options . _parentElm
84
81
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
+
85
89
if ( options . render ) {
86
90
opts . render = options . render
87
91
opts . staticRenderFns = options . staticRenderFns
Original file line number Diff line number Diff line change @@ -200,15 +200,10 @@ export function createComponentInstanceForVnode (
200
200
parentElm ?: ?Node ,
201
201
refElm ?: ?Node
202
202
) : Component {
203
- const vnodeComponentOptions = vnode . componentOptions
204
203
const options : InternalComponentOptions = {
205
204
_isComponent : true ,
206
205
parent,
207
- propsData : vnodeComponentOptions . propsData ,
208
- _componentTag : vnodeComponentOptions . tag ,
209
206
_parentVnode : vnode ,
210
- _parentListeners : vnodeComponentOptions . listeners ,
211
- _renderChildren : vnodeComponentOptions . children ,
212
207
_parentElm : parentElm || null ,
213
208
_refElm : refElm || null
214
209
}
@@ -218,7 +213,7 @@ export function createComponentInstanceForVnode (
218
213
options . render = inlineTemplate . render
219
214
options . staticRenderFns = inlineTemplate . staticRenderFns
220
215
}
221
- return new vnodeComponentOptions . Ctor ( options )
216
+ return new vnode . componentOptions . Ctor ( options )
222
217
}
223
218
224
219
function mergeHooks ( data : VNodeData ) {
You can’t perform that action at this time.
0 commit comments