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
  07b8a4e2_c844_2a5f_74ac_9aa256338f3b["genStyleSegments()"]
  96d38cc7_62ee_04de_8f49_73340fb7f3ad["elementToOpenTagSegments()"]
  96d38cc7_62ee_04de_8f49_73340fb7f3ad -->|calls| 07b8a4e2_c844_2a5f_74ac_9aa256338f3b
  style 07b8a4e2_c844_2a5f_74ac_9aa256338f3b 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.
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