mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
wip
This commit is contained in:
@@ -289,24 +289,24 @@ exports[`slots conditional slot 1`] = `
|
||||
let { capture, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
|
||||
function slotFn1(ctx, node, key = \\"\\") {
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
return text(\`blue\`);
|
||||
}
|
||||
|
||||
function slotFn2(ctx, node, key = \\"\\") {
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
return text(\`red\`);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let slot1 = {};
|
||||
let slots1 = {};
|
||||
if (ctx['state'].flag) {
|
||||
const ctx1 = capture(ctx);
|
||||
slot1['abc'] = {__render: slotFn1.bind(this), __ctx: ctx1};
|
||||
slots1['abc'] = {__render: slot1.bind(this), __ctx: ctx1};
|
||||
} else {
|
||||
const ctx2 = capture(ctx);
|
||||
slot1['abc'] = {__render: slotFn2.bind(this), __ctx: ctx2};
|
||||
slots1['abc'] = {__render: slot2.bind(this), __ctx: ctx2};
|
||||
}
|
||||
const b4 = comp1({slots: markRaw(slot1)}, key + \`__1\`, node, this, null);
|
||||
return comp1({slots: markRaw(slots1)}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1476,7 +1476,8 @@ exports[`slots simple default slot 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return comp1({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
||||
let slots1 = markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}});
|
||||
return comp1({slots: slots1}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1575,7 +1576,8 @@ exports[`slots simple default slot, variation 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return comp1({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
||||
let slots1 = markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}});
|
||||
return comp1({slots: slots1}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -2882,16 +2884,23 @@ exports[`slots t-set-slot=default has priority over rest of the content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, markRaw } = helpers;
|
||||
let { markRaw, capture } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\` some text \`);
|
||||
const ctx2 = capture(ctx);
|
||||
return multi([b2]);
|
||||
}
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
return text(\`some other text\`);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const ctx1 = capture(ctx);
|
||||
return comp1({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
let slots1 = markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}});
|
||||
return comp1({slots: slots1}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user