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

Function buildDynamicSlot

packages/compiler-core/src/transforms/vSlot.ts:382–397  ·  view source on GitHub ↗
(
  name: ExpressionNode,
  fn: FunctionExpression,
  index?: number,
)

Source from the content-addressed store, hash-verified

380}
381
382function buildDynamicSlot(
383 name: ExpressionNode,
384 fn: FunctionExpression,
385 index?: number,
386): ObjectExpression {
387 const props = [
388 createObjectProperty(`name`, name),
389 createObjectProperty(`fn`, fn),
390 ]
391 if (index != null) {
392 props.push(
393 createObjectProperty(`key`, createSimpleExpression(String(index), true)),
394 )
395 }
396 return createObjectExpression(props)
397}
398
399function hasForwardedSlots(children: TemplateChildNode[]): boolean {
400 for (let i = 0; i < children.length; i++) {

Callers 1

buildSlotsFunction · 0.85

Calls 5

createObjectPropertyFunction · 0.90
createSimpleExpressionFunction · 0.90
createObjectExpressionFunction · 0.90
StringInterface · 0.85
pushMethod · 0.65

Tested by

no test coverage detected