diff --git a/src/compile/render-ssr/handlers/Element.ts b/src/compile/render-ssr/handlers/Element.ts index d7bc823be2..acda204215 100644 --- a/src/compile/render-ssr/handlers/Element.ts +++ b/src/compile/render-ssr/handlers/Element.ts @@ -84,6 +84,9 @@ export default function(node, renderer, options) { ) { // a boolean attribute with one non-Text chunk args.push(`{ ${quoteNameIfNecessary(attribute.name)}: ${attribute.chunks[0].snippet} }`); + } else if (attribute.name === 'class' && classExpr) { + // Add class expression + args.push(`{ ${quoteNameIfNecessary(attribute.name)}: [\`${stringifyAttribute(attribute)}\`, \`\${${classExpr}}\`].join(' ').trim() }`); } else { args.push(`{ ${quoteNameIfNecessary(attribute.name)}: \`${stringifyAttribute(attribute)}\` }`); } @@ -159,4 +162,4 @@ function stringifyAttribute(attribute: Attribute) { return '${@escape(' + chunk.snippet + ')}'; }) .join(''); -} \ No newline at end of file +}