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
  a6f31758_a9cf_b7dc_09d6_0b57380360f7["childrenToSegments()"]
  3cd1373c_a2c0_adeb_be13_1bf1ff92c1e2["genChildrenAsStringNode()"]
  3cd1373c_a2c0_adeb_be13_1bf1ff92c1e2 -->|calls| a6f31758_a9cf_b7dc_09d6_0b57380360f7
  e2a158d6_845c_6930_8656_68576142a273["elementToSegments()"]
  e2a158d6_845c_6930_8656_68576142a273 -->|calls| a6f31758_a9cf_b7dc_09d6_0b57380360f7
  798a16d6_69b7_5315_0f50_948e7cbca09d["nodesToSegments()"]
  a6f31758_a9cf_b7dc_09d6_0b57380360f7 -->|calls| 798a16d6_69b7_5315_0f50_948e7cbca09d
  style a6f31758_a9cf_b7dc_09d6_0b57380360f7 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.
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