File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ declare interface Component {
2525 $children: Array < Component > ;
2626 $refs: { [ key : string ] : Component | Element | Array < Component | Element > | void } ;
2727 $slots: { [ key : string ] : Array < VNode > } ;
28- $scopedSlots: ? { [ key : string ] : ( ) => VNodeChildren } ;
28+ $scopedSlots: { [ key : string ] : ( ) => VNodeChildren } ;
2929 $vnode: VNode ;
3030 $isServer: boolean ;
3131
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export function initRender (vm: Component) {
1616 vm . _staticTrees = null
1717 vm . _renderContext = vm . $options . _parentVnode && vm . $options . _parentVnode . context
1818 vm . $slots = resolveSlots ( vm . $options . _renderChildren , vm . _renderContext )
19- vm . $scopedSlots = null
19+ vm . $scopedSlots = { }
2020 // bind the public createElement fn to this instance
2121 // so that we get proper render context inside it.
2222 vm . $createElement = bind ( createElement , vm )
@@ -45,7 +45,7 @@ export function renderMixin (Vue: Class<Component>) {
4545 }
4646 }
4747
48- if ( _parentVnode ) {
48+ if ( _parentVnode && _parentVnode . data . scopedSlots ) {
4949 vm . $scopedSlots = _parentVnode . data . scopedSlots
5050 }
5151
@@ -191,7 +191,7 @@ export function renderMixin (Vue: Class<Component>) {
191191 fallback : ?Array < VNode > ,
192192 props : ?Object
193193 ) : ?Array < VNode > {
194- const scopedSlotFn = this . $scopedSlots && this . $scopedSlots [ name ]
194+ const scopedSlotFn = this . $scopedSlots [ name ]
195195 if ( scopedSlotFn ) { // scoped slot
196196 return scopedSlotFn ( props || { } ) || fallback
197197 } else {
You can’t perform that action at this time.
0 commit comments