mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] components: allow prop names that are not valid bare property name
This commit is contained in:
committed by
Aaron Bohy
parent
b90180a9e0
commit
93b88cad8d
@@ -967,7 +967,7 @@ export class CodeGenerator {
|
||||
const props: string[] = [];
|
||||
let hasSlotsProp = false;
|
||||
for (let p in ast.props) {
|
||||
const propName = p.includes("-") ? `'${p}'` : p;
|
||||
const propName = /^[a-z_]+$/i.test(p) ? p : `'${p}'`;
|
||||
props.push(`${propName}: ${this.captureExpression(ast.props[p]) || undefined}`);
|
||||
if (p === "slots") {
|
||||
hasSlotsProp = true;
|
||||
|
||||
Reference in New Issue
Block a user