Home / Function/ childrenToSegments() — vue Function Reference

childrenToSegments() — vue Function Reference

Architecture documentation for the childrenToSegments() function in codegen.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  6b525ab7_8f33_9239_ab39_05dda7ea53e5["childrenToSegments()"]
  4aaa14b9_d580_5a66_5221_1be3a11a7eed["codegen.ts"]
  6b525ab7_8f33_9239_ab39_05dda7ea53e5 -->|defined in| 4aaa14b9_d580_5a66_5221_1be3a11a7eed
  c9f5cd05_4bd2_e40a_83fa_edb34d6fd988["genChildrenAsStringNode()"]
  c9f5cd05_4bd2_e40a_83fa_edb34d6fd988 -->|calls| 6b525ab7_8f33_9239_ab39_05dda7ea53e5
  fab98570_5fb1_9215_7014_b249b0beadde["elementToSegments()"]
  fab98570_5fb1_9215_7014_b249b0beadde -->|calls| 6b525ab7_8f33_9239_ab39_05dda7ea53e5
  3305260c_9a97_7ffb_f077_598c0d28f4ff["nodesToSegments()"]
  6b525ab7_8f33_9239_ab39_05dda7ea53e5 -->|calls| 3305260c_9a97_7ffb_f077_598c0d28f4ff
  style 6b525ab7_8f33_9239_ab39_05dda7ea53e5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/optimizing-compiler/codegen.ts lines 198–210

function childrenToSegments(el, state): Array<StringSegment> {
  let binding
  if ((binding = el.attrsMap['v-html'])) {
    return [{ type: EXPRESSION, value: `_s(${binding})` }]
  }
  if ((binding = el.attrsMap['v-text'])) {
    return [{ type: INTERPOLATION, value: `_s(${binding})` }]
  }
  if (el.tag === 'textarea' && (binding = el.attrsMap['v-model'])) {
    return [{ type: INTERPOLATION, value: `_s(${binding})` }]
  }
  return el.children ? nodesToSegments(el.children, state) : []
}

Subdomains

Frequently Asked Questions

What does childrenToSegments() do?
childrenToSegments() is a function in the vue codebase, defined in packages/server-renderer/src/optimizing-compiler/codegen.ts.
Where is childrenToSegments() defined?
childrenToSegments() is defined in packages/server-renderer/src/optimizing-compiler/codegen.ts at line 198.
What does childrenToSegments() call?
childrenToSegments() calls 1 function(s): nodesToSegments.
What calls childrenToSegments()?
childrenToSegments() is called by 2 function(s): elementToSegments, genChildrenAsStringNode.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free