mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler, components: allow empty slot
Before this commit, a t-set-slot that has no content was not even compiled, and thus not passed to the component for which it has was defined After this commit, we allow a t-set-slot to have no content (because it can have slot props)
This commit is contained in:
committed by
Géry Debongnie
parent
55dbc01a1b
commit
de240b1ebc
@@ -1115,8 +1115,11 @@ export class CodeGenerator {
|
||||
let slotStr: string[] = [];
|
||||
for (let slotName in ast.slots) {
|
||||
const slotAst = ast.slots[slotName];
|
||||
const name = this.compileInNewTarget("slot", slotAst.content, ctx, slotAst.on);
|
||||
const params = [`__render: ${name}, __ctx: ${ctxStr}`];
|
||||
const params = [];
|
||||
if (slotAst.content) {
|
||||
const name = this.compileInNewTarget("slot", slotAst.content, ctx, slotAst.on);
|
||||
params.push(`__render: ${name}, __ctx: ${ctxStr}`);
|
||||
}
|
||||
const scope = ast.slots[slotName].scope;
|
||||
if (scope) {
|
||||
params.push(`__scope: "${scope}"`);
|
||||
|
||||
Reference in New Issue
Block a user