|
|
@@ -42,10 +42,16 @@ export function ssrRenderAttrs(
|
|
|
const value = props[key]
|
|
|
// force as attribute
|
|
|
if (key.startsWith('^')) key = key.slice(1)
|
|
|
- if (key === 'class' || key === 'className') {
|
|
|
+ if (key === 'class') {
|
|
|
ret += ` class="${ssrRenderClass(value)}"`
|
|
|
} else if (key === 'style') {
|
|
|
ret += ` style="${ssrRenderStyle(value)}"`
|
|
|
+ } else if (key === 'className') {
|
|
|
+ // className should not go through ssrRenderClass which normalizes non-string
|
|
|
+ // values into strings. it should coerce directly into strings
|
|
|
+ if (value != null) {
|
|
|
+ ret += ` class="${escapeHtml(String(value))}"`
|
|
|
+ }
|
|
|
} else {
|
|
|
ret += ssrRenderDynamicAttr(key, value, tag)
|
|
|
}
|