[IMP] qweb: compiler: support t-key on node and component without t-foreach

This commit is contained in:
Lucas Perais (lpe)
2021-11-04 13:46:49 +01:00
committed by Aaron Bohy
parent 16f1e2c237
commit 7c04cc425e
19 changed files with 722 additions and 64 deletions
@@ -79,8 +79,9 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers;
return function template(ctx, node, key = \\"\\") {
let Comp2 = ctx['myComponent'];
return toggler(Comp2, component(Comp2, {}, key + \`__1\`, node, ctx));
const tKey_1 = ctx['state'].child;
let Comp3 = ctx['myComponent'];
return toggler(tKey_1, toggler(Comp3, component(Comp3, {}, tKey_1 + key + \`__2\`, node, ctx)));
}
}"
`;
@@ -120,8 +121,9 @@ exports[`t-component can use dynamic components (the class) if given 3`] = `
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers;
return function template(ctx, node, key = \\"\\") {
let Comp2 = ctx['myComponent'];
return toggler(Comp2, component(Comp2, {}, key + \`__1\`, node, ctx));
const tKey_1 = ctx['state'].child;
let Comp3 = ctx['myComponent'];
return toggler(tKey_1, toggler(Comp3, component(Comp3, {}, tKey_1 + key + \`__2\`, node, ctx)));
}
}"
`;