vFor: DirectiveNode | undefined,
slotChildren: TemplateChildNode[],
loc: SourceLocation,
+ parent: ElementNode,
) => FunctionExpression
const buildClientSlotFn: SlotFnBuilder = (props, _vForExp, children, loc) =>
slotsProperties.push(
createObjectProperty(
arg || createSimpleExpression('default', true),
- buildSlotFn(exp, undefined, children, loc),
+ buildSlotFn(exp, undefined, children, loc, node),
),
)
}
}
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
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
}
// fallback in case the child is render-fn based). Store them in an array
// for later use.
if (clonedNode.children.length) {
- buildSlots(clonedNode, context, (props, vFor, children) => {
+ buildSlots(clonedNode, context, (props, vFor, children, _loc, parent) => {
vnodeBranches.push(
- createVNodeSlotBranch(props, vFor, children, context, clonedNode),
+ createVNodeSlotBranch(props, vFor, children, context, parent),
)
return createFunctionExpression(undefined)
})