mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] components: make sure t-ref work with t-if/t-else
This commit is contained in:
committed by
Aaron Bohy
parent
9f2e2bcc66
commit
92cc4375f8
@@ -25,8 +25,8 @@ exports[`t-ref can get a ref on a node 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
let d1 = (el) => refs[\`myspan\`] = el;
|
||||
return block1([d1]);
|
||||
const ref1 = (el) => refs[\`myspan\`] = el;
|
||||
return block1([ref1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -56,8 +56,8 @@ exports[`t-ref ref in a t-call 2`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
let d1 = (el) => refs[\`name\`] = el;
|
||||
return block1([d1]);
|
||||
const ref1 = (el) => refs[\`name\`] = el;
|
||||
return block1([ref1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -72,10 +72,10 @@ exports[`t-ref ref in a t-if 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`name\`] = el;
|
||||
let b2;
|
||||
if (ctx['condition']) {
|
||||
let d1 = (el) => refs[\`name\`] = el;
|
||||
b2 = block2([d1]);
|
||||
b2 = block2([ref1]);
|
||||
}
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -120,13 +120,13 @@ exports[`t-ref two refs, one in a t-if 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`name\`] = el;
|
||||
const ref2 = (el) => refs[\`p\`] = el;
|
||||
let b2;
|
||||
if (ctx['condition']) {
|
||||
let d1 = (el) => refs[\`name\`] = el;
|
||||
b2 = block2([d1]);
|
||||
b2 = block2([ref1]);
|
||||
}
|
||||
let d2 = (el) => refs[\`p\`] = el;
|
||||
return block1([d2], [b2]);
|
||||
return block1([ref2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user