[FIX] props: prop names can contain -

This commit is contained in:
Mathieu Duckerts-Antoine
2021-11-22 17:05:08 +01:00
committed by Aaron Bohy
parent 8239a5d2cd
commit b90180a9e0
3 changed files with 43 additions and 1 deletions
+2 -1
View File
@@ -967,7 +967,8 @@ export class CodeGenerator {
const props: string[] = [];
let hasSlotsProp = false;
for (let p in ast.props) {
props.push(`${p}: ${this.captureExpression(ast.props[p]) || undefined}`);
const propName = p.includes("-") ? `'${p}'` : p;
props.push(`${propName}: ${this.captureExpression(ast.props[p]) || undefined}`);
if (p === "slots") {
hasSlotsProp = true;
}