Home / Function/ genClassSegments() — vue Function Reference

genClassSegments() — vue Function Reference

Architecture documentation for the genClassSegments() function in modules.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  19897393_a1e2_9221_0e22_5928060eae7c["genClassSegments()"]
  92853cf6_4176_f03f_0670_cca3d63c003e["modules.ts"]
  19897393_a1e2_9221_0e22_5928060eae7c -->|defined in| 92853cf6_4176_f03f_0670_cca3d63c003e
  9d3b67d4_d578_dee4_50a8_8ed82301c536["elementToOpenTagSegments()"]
  9d3b67d4_d578_dee4_50a8_8ed82301c536 -->|calls| 19897393_a1e2_9221_0e22_5928060eae7c
  style 19897393_a1e2_9221_0e22_5928060eae7c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/optimizing-compiler/modules.ts lines 80–94

export function genClassSegments(
  staticClass: string | null | undefined,
  classBinding: string | null | undefined
): Array<StringSegment> {
  if (staticClass && !classBinding) {
    return [{ type: RAW, value: ` class="${JSON.parse(staticClass)}"` }]
  } else {
    return [
      {
        type: EXPRESSION,
        value: `_ssrClass(${staticClass || 'null'},${classBinding || 'null'})`
      }
    ]
  }
}

Subdomains

Frequently Asked Questions

What does genClassSegments() do?
genClassSegments() is a function in the vue codebase, defined in packages/server-renderer/src/optimizing-compiler/modules.ts.
Where is genClassSegments() defined?
genClassSegments() is defined in packages/server-renderer/src/optimizing-compiler/modules.ts at line 80.
What calls genClassSegments()?
genClassSegments() is called by 1 function(s): elementToOpenTagSegments.

Analyze Your Own Codebase

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

Try Supermodel Free