MCPcopy
hub / github.com/vuejs/core / buildSSRSlotFn

Function buildSSRSlotFn

packages/compiler-ssr/src/transforms/ssrTransformComponent.ts:156–173  ·  view source on GitHub ↗
(props, _vForExp, children, loc)

Source from the content-addressed store, hash-verified

154 wipMap.set(node, wipEntries)
155
156 const buildSSRSlotFn: SlotFnBuilder = (props, _vForExp, children, loc) => {
157 const param0 = (props && stringifyExpression(props)) || `_`
158 const fn = createFunctionExpression(
159 [param0, `_push`, `_parent`, `_scopeId`],
160 undefined, // no return, assign body later
161 true, // newline
162 true, // isSlot
163 loc,
164 )
165 wipEntries.push({
166 type: WIP_SLOT,
167 fn,
168 children,
169 // also collect the corresponding vnode branch built earlier
170 vnodeBranch: vnodeBranches[wipEntries.length],
171 })
172 return fn
173 }
174
175 const slots = node.children.length
176 ? buildSlots(node, context, buildSSRSlotFn).slots

Callers

nothing calls this directly

Calls 3

stringifyExpressionFunction · 0.85
createFunctionExpressionFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected