mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] compiler: improve generated compiled code
This commit is contained in:
@@ -8,8 +8,8 @@ exports[`reactivity in lifecycle can use a state hook 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['counter'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['counter'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -22,8 +22,8 @@ exports[`reactivity in lifecycle can use a state hook 2 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].a;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].a;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -36,8 +36,8 @@ exports[`reactivity in lifecycle change state while mounting component 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -67,9 +67,9 @@ exports[`reactivity in lifecycle state changes in willUnmount do not trigger rer
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
let d2 = ctx['state'].n;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].val;
|
||||
let txt2 = ctx['state'].n;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user