mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
improve generated code by qweb_vdom
This commit is contained in:
@@ -86,7 +86,7 @@ export class Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addLine(line: string) {
|
addLine(line: string) {
|
||||||
const prefix = new Array(this.indentLevel).join("\t");
|
const prefix = new Array(this.indentLevel + 2).join(" ");
|
||||||
this.code.push(prefix + line);
|
this.code.push(prefix + line);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,8 +398,9 @@ export class QWeb {
|
|||||||
ctx.dedent();
|
ctx.dedent();
|
||||||
ctx.addLine(`}`);
|
ctx.addLine(`}`);
|
||||||
}
|
}
|
||||||
ctx.addLine(`
|
ctx.addLine(
|
||||||
let vn${nodeID} = h('${node.nodeName}', p${nodeID}, c${nodeID});`);
|
`let vn${nodeID} = h('${node.nodeName}', p${nodeID}, c${nodeID});`
|
||||||
|
);
|
||||||
if (ctx.parentNode) {
|
if (ctx.parentNode) {
|
||||||
ctx.addLine(`c${ctx.parentNode}.push(vn${nodeID});`);
|
ctx.addLine(`c${ctx.parentNode}.push(vn${nodeID});`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user