MCPcopy
hub / github.com/vuejs/core / stringifyStyle

Function stringifyStyle

packages/shared/src/normalizeProp.ts:45–61  ·  packages/shared/src/normalizeProp.ts::stringifyStyle
(
  styles: NormalizedStyle | string | undefined,
)

Source from the content-addressed store, hash-verified

43}
44
45export function stringifyStyle(
46 styles: NormalizedStyle | string | undefined,
47): string {
48 if (!styles) return class="st">''
49 if (isString(styles)) return styles
50
51 let ret = class="st">''
52 for (const key in styles) {
53 const value = styles[key]
54 if (isString(value) || typeof value === class="st">'number') {
55 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key)
56 class="cm">// only render valid values
57 ret += `${normalizedKey}:${value};`
58 }
59 }
60 return ret
61}
62
63export function normalizeClass(value: unknown): string {
64 let res = class="st">''

Callers 4

stringifyElementFunction · 0.90
ssrRenderStyleFunction · 0.90
propHasMismatchFunction · 0.90

Calls 1

isStringFunction · 0.90

Tested by

no test coverage detected