mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
wip
This commit is contained in:
+18
-20
@@ -45,25 +45,23 @@ function compileValueNode(value: any, node: Element, qweb: QWeb, ctx: Compilatio
|
|||||||
exprID = `scope.${value.id}`;
|
exprID = `scope.${value.id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let protectID;
|
let protectID;
|
||||||
if (value.hasBody) {
|
if (value.hasBody) {
|
||||||
ctx.rootContext.shouldDefineUtils = true;
|
ctx.rootContext.shouldDefineUtils = true;
|
||||||
protectID = ctx.startProtectScope();
|
protectID = ctx.startProtectScope();
|
||||||
ctx.addLine(
|
ctx.addLine(
|
||||||
`${exprID} = ${exprID} instanceof utils.VDomArray ? utils.vDomToString(${exprID}) : ${exprID};`
|
`${exprID} = ${exprID} instanceof utils.VDomArray ? utils.vDomToString(${exprID}) : ${exprID};`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (node.childNodes.length) {
|
if (node.childNodes.length) {
|
||||||
// ctx.addLine(`c${ctx.parentNode}.push(...vnodeArray);`);
|
// ctx.addLine(`c${ctx.parentNode}.push(...vnodeArray);`);
|
||||||
ctx.addIf(`!${exprID}`);
|
ctx.addIf(`!${exprID}`);
|
||||||
// if (node.childNodes.length) {
|
// if (node.childNodes.length) {
|
||||||
// ctx.addElse();
|
// ctx.addElse();
|
||||||
qweb._compileChildren(node, ctx);
|
qweb._compileChildren(node, ctx);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
ctx.closeIf();
|
|
||||||
|
|
||||||
|
|
||||||
|
ctx.closeIf();
|
||||||
}
|
}
|
||||||
if (ctx.parentTextNode) {
|
if (ctx.parentTextNode) {
|
||||||
ctx.addIf(`${exprID} != null`);
|
ctx.addIf(`${exprID} != null`);
|
||||||
@@ -84,9 +82,9 @@ function compileValueNode(value: any, node: Element, qweb: QWeb, ctx: Compilatio
|
|||||||
}
|
}
|
||||||
ctx.closeIf();
|
ctx.closeIf();
|
||||||
}
|
}
|
||||||
if (value.hasBody) {
|
if (value.hasBody) {
|
||||||
ctx.stopProtectScope(protectID);
|
ctx.stopProtectScope(protectID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ctx.addIf(`${exprID} != null`);
|
// ctx.addIf(`${exprID} != null`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user