@@ -17,9 +17,10 @@ import { isUpdatingChildComponent } from './lifecycle'
17
17
18
18
export function initRender ( vm : Component ) {
19
19
vm . _vnode = null // the root of the child tree
20
- const parentVnode = vm . $vnode = vm . $options . _parentVnode // the placeholder node in parent tree
20
+ const options = vm . $options
21
+ const parentVnode = vm . $vnode = options . _parentVnode // the placeholder node in parent tree
21
22
const renderContext = parentVnode && parentVnode . context
22
- vm . $slots = resolveSlots ( vm . $ options. _renderChildren , renderContext )
23
+ vm . $slots = resolveSlots ( options . _renderChildren , renderContext )
23
24
vm . $scopedSlots = emptyObject
24
25
// bind the createElement fn to this instance
25
26
// so that we get proper render context inside it.
@@ -39,12 +40,12 @@ export function initRender (vm: Component) {
39
40
defineReactive ( vm , '$attrs' , parentData && parentData . attrs || emptyObject , ( ) => {
40
41
! isUpdatingChildComponent && warn ( `$attrs is readonly.` , vm )
41
42
} , true )
42
- defineReactive ( vm , '$listeners' , vm . $ options. _parentListeners || emptyObject , ( ) => {
43
+ defineReactive ( vm , '$listeners' , options . _parentListeners || emptyObject , ( ) => {
43
44
! isUpdatingChildComponent && warn ( `$listeners is readonly.` , vm )
44
45
} , true )
45
46
} else {
46
47
defineReactive ( vm , '$attrs' , parentData && parentData . attrs || emptyObject , null , true )
47
- defineReactive ( vm , '$listeners' , vm . $ options. _parentListeners || emptyObject , null , true )
48
+ defineReactive ( vm , '$listeners' , options . _parentListeners || emptyObject , null , true )
48
49
}
49
50
}
50
51
0 commit comments