Skip to content

Commit

Permalink
refactor(perf): assign value in if block (vuejs#10836)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plumbiu authored and lynxlangya committed May 30, 2024
1 parent e7ddedf commit 7a29f31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/normalizeProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export function stringifyStyle(
}
for (const key in styles) {
const value = styles[key]
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key)
if (isString(value) || typeof value === 'number') {
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key)
// only render valid values
ret += `${normalizedKey}:${value};`
}
Expand Down

0 comments on commit 7a29f31

Please sign in to comment.