mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: compile named slot in t-component in named slot
Previously, if a t-set-slot was inside a t-component itself inside a t-set-slot the parser would crash, because the slot is removed from the template before compiling its content, causing a further check's assumption to be broken (the t-set-slot remains connected to the component's xml node)
This commit is contained in:
committed by
Géry Debongnie
parent
b7c37ca69a
commit
a53e42518f
@@ -1673,6 +1673,31 @@ describe("slots", () => {
|
||||
expect(fixture.innerHTML).toBe("<div><div><p>Ablip</p><div><p>Bblip</p></div></div></div>");
|
||||
});
|
||||
|
||||
test("named slot inside named slot in t-component", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<t t-slot="brol"/>`;
|
||||
}
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<Child>
|
||||
<t t-set-slot="brol">
|
||||
outer
|
||||
<t t-component="Child">
|
||||
<t t-set-slot="brol">
|
||||
<t t-esc="value"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</Child>`;
|
||||
static components = { Child };
|
||||
Child = Child;
|
||||
value = "inner";
|
||||
}
|
||||
await mount(Parent, fixture);
|
||||
|
||||
expect(fixture.innerHTML).toBe(" outer inner");
|
||||
});
|
||||
|
||||
test("can render only empty slot", async () => {
|
||||
class Parent extends Component {
|
||||
static template = xml`<t t-slot="default"/>`;
|
||||
|
||||
Reference in New Issue
Block a user