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
  3be419e7_8dab_cff3_f795_b67baf1ae876["genStyleSegments()"]
  480317ab_b1ef_f907_829e_f74af9eae452["elementToOpenTagSegments()"]
  480317ab_b1ef_f907_829e_f74af9eae452 -->|calls| 3be419e7_8dab_cff3_f795_b67baf1ae876
  style 3be419e7_8dab_cff3_f795_b67baf1ae876 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