|
|
@@ -100,6 +100,7 @@ export type SlotFnBuilder = (
|
|
|
vFor: DirectiveNode | undefined,
|
|
|
slotChildren: TemplateChildNode[],
|
|
|
loc: SourceLocation,
|
|
|
+ parent: ElementNode,
|
|
|
) => FunctionExpression
|
|
|
|
|
|
const buildClientSlotFn: SlotFnBuilder = (props, _vForExp, children, loc) =>
|
|
|
@@ -147,7 +148,7 @@ export function buildSlots(
|
|
|
slotsProperties.push(
|
|
|
createObjectProperty(
|
|
|
arg || createSimpleExpression('default', true),
|
|
|
- buildSlotFn(exp, undefined, children, loc),
|
|
|
+ buildSlotFn(exp, undefined, children, loc, node),
|
|
|
),
|
|
|
)
|
|
|
}
|
|
|
@@ -200,7 +201,13 @@ export function buildSlots(
|
|
|
}
|
|
|
|
|
|
const vFor = findDir(slotElement, 'for')
|
|
|
- const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc)
|
|
|
+ const slotFunction = buildSlotFn(
|
|
|
+ slotProps,
|
|
|
+ vFor,
|
|
|
+ slotChildren,
|
|
|
+ slotLoc,
|
|
|
+ slotElement,
|
|
|
+ )
|
|
|
|
|
|
// check if this slot is conditional (v-if/v-for)
|
|
|
let vIf: DirectiveNode | undefined
|
|
|
@@ -304,7 +311,7 @@ export function buildSlots(
|
|
|
props: ExpressionNode | undefined,
|
|
|
children: TemplateChildNode[],
|
|
|
) => {
|
|
|
- const fn = buildSlotFn(props, undefined, children, loc)
|
|
|
+ const fn = buildSlotFn(props, undefined, children, loc, node)
|
|
|
if (__COMPAT__ && context.compatConfig) {
|
|
|
fn.isNonScopedSlot = true
|
|
|
}
|