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
@@ -1370,6 +1370,25 @@ describe("qweb parser", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("a component with an empty named slot", async () => {
|
||||
expect(parse(`<MyComponent><t t-set-slot="mySlot"></t></MyComponent>`)).toEqual({
|
||||
dynamicProps: null,
|
||||
isDynamic: false,
|
||||
name: "MyComponent",
|
||||
on: null,
|
||||
props: null,
|
||||
slots: {
|
||||
mySlot: {
|
||||
attrs: null,
|
||||
content: null,
|
||||
on: null,
|
||||
scope: null,
|
||||
},
|
||||
},
|
||||
type: 11,
|
||||
});
|
||||
});
|
||||
|
||||
test("a component with a named slot", async () => {
|
||||
expect(parse(`<MyComponent><t t-set-slot="name">foo</t></MyComponent>`)).toEqual({
|
||||
type: ASTType.TComponent,
|
||||
|
||||
Reference in New Issue
Block a user