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

Function ssrProcessElement

packages/compiler-ssr/src/transforms/ssrTransformElement.ts:460–489  ·  view source on GitHub ↗
(
  node: PlainElementNode,
  context: SSRTransformContext,
)

Source from the content-addressed store, hash-verified

458}
459
460export function ssrProcessElement(
461 node: PlainElementNode,
462 context: SSRTransformContext,
463): void {
464 const isVoidTag = context.options.isVoidTag || NO
465 const elementsToAdd = node.ssrCodegenNode!.elements
466 for (let j = 0; j < elementsToAdd.length; j++) {
467 context.pushStringPart(elementsToAdd[j])
468 }
469
470 // Handle slot scopeId
471 if (context.withSlotScopeId) {
472 context.pushStringPart(createSimpleExpression(`_scopeId`, false))
473 }
474
475 // close open tag
476 context.pushStringPart(`>`)
477
478 const rawChildren = rawChildrenMap.get(node)
479 if (rawChildren) {
480 context.pushStringPart(rawChildren)
481 } else if (node.children.length) {
482 processChildren(node, context)
483 }
484
485 if (!isVoidTag(node.tag)) {
486 // push closing tag
487 context.pushStringPart(`</${node.tag}>`)
488 }
489}

Callers 1

processChildrenFunction · 0.90

Calls 4

processChildrenFunction · 0.90
createSimpleExpressionFunction · 0.85
pushStringPartMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected