Home / Function/ genStyleSegments() — vue Function Reference

genStyleSegments() — vue Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

packages/server-renderer/src/optimizing-compiler/modules.ts lines 96–118

export function genStyleSegments(
  staticStyle: string | null | undefined,
  parsedStaticStyle: string | null | undefined,
  styleBinding: string | null | undefined,
  vShowExpression: string | null | undefined
): Array<StringSegment> {
  if (staticStyle && !styleBinding && !vShowExpression) {
    return [{ type: RAW, value: ` style=${JSON.stringify(staticStyle)}` }]
  } else {
    return [
      {
        type: EXPRESSION,
        value: `_ssrStyle(${parsedStaticStyle || 'null'},${
          styleBinding || 'null'
        }, ${
          vShowExpression
            ? `{ display: (${vShowExpression}) ? '' : 'none' }`
            : 'null'
        })`
      }
    ]
  }
}

Subdomains

Frequently Asked Questions

What does genStyleSegments() do?
genStyleSegments() is a function in the vue codebase, defined in packages/server-renderer/src/optimizing-compiler/modules.ts.
Where is genStyleSegments() defined?
genStyleSegments() is defined in packages/server-renderer/src/optimizing-compiler/modules.ts at line 96.
What calls genStyleSegments()?
genStyleSegments() 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