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
  bab0d1f4_5d24_925c_fdf7_6073527f64b7["childrenToSegments()"]
  d70222cb_3265_c3fc_c0cf_09247995ea9a["codegen.ts"]
  bab0d1f4_5d24_925c_fdf7_6073527f64b7 -->|defined in| d70222cb_3265_c3fc_c0cf_09247995ea9a
  2fca87b5_3c3d_6d7a_6f06_d5b4a0981171["genChildrenAsStringNode()"]
  2fca87b5_3c3d_6d7a_6f06_d5b4a0981171 -->|calls| bab0d1f4_5d24_925c_fdf7_6073527f64b7
  0a738585_4681_2f66_e7c0_146bcca3724c["elementToSegments()"]
  0a738585_4681_2f66_e7c0_146bcca3724c -->|calls| bab0d1f4_5d24_925c_fdf7_6073527f64b7
  075d79be_dda5_c8d2_8ce4_d7f859be1677["nodesToSegments()"]
  bab0d1f4_5d24_925c_fdf7_6073527f64b7 -->|calls| 075d79be_dda5_c8d2_8ce4_d7f859be1677
  style bab0d1f4_5d24_925c_fdf7_6073527f64b7 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