@@ -100,6 +100,7 @@ export type SlotFnBuilder = (
100100 vFor : DirectiveNode | undefined ,
101101 slotChildren : TemplateChildNode [ ] ,
102102 loc : SourceLocation ,
103+ parent : ElementNode ,
103104) => FunctionExpression
104105
105106const buildClientSlotFn : SlotFnBuilder = ( props , _vForExp , children , loc ) =>
@@ -147,7 +148,7 @@ export function buildSlots(
147148 slotsProperties . push (
148149 createObjectProperty (
149150 arg || createSimpleExpression ( 'default' , true ) ,
150- buildSlotFn ( exp , undefined , children , loc ) ,
151+ buildSlotFn ( exp , undefined , children , loc , node ) ,
151152 ) ,
152153 )
153154 }
@@ -200,7 +201,13 @@ export function buildSlots(
200201 }
201202
202203 const vFor = findDir ( slotElement , 'for' )
203- const slotFunction = buildSlotFn ( slotProps , vFor , slotChildren , slotLoc )
204+ const slotFunction = buildSlotFn (
205+ slotProps ,
206+ vFor ,
207+ slotChildren ,
208+ slotLoc ,
209+ slotElement ,
210+ )
204211
205212 // check if this slot is conditional (v-if/v-for)
206213 let vIf : DirectiveNode | undefined
@@ -304,7 +311,7 @@ export function buildSlots(
304311 props : ExpressionNode | undefined ,
305312 children : TemplateChildNode [ ] ,
306313 ) => {
307- const fn = buildSlotFn ( props , undefined , children , loc )
314+ const fn = buildSlotFn ( props , undefined , children , loc , node )
308315 if ( __COMPAT__ && context . compatConfig ) {
309316 fn . isNonScopedSlot = true
310317 }
0 commit comments