mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] slots: allow t-call and components in slot default content
This commit is contained in:
committed by
Géry Debongnie
parent
840348892f
commit
92174559a1
@@ -1434,4 +1434,33 @@ describe("slots", () => {
|
||||
}
|
||||
expect(error).toBeNull();
|
||||
});
|
||||
|
||||
test("can use t-call in default-content of t-slot", async () => {
|
||||
const template = xml``;
|
||||
class Child extends Component {
|
||||
static template = xml`<t t-slot="default"><t t-call="${template}"/></t>`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`<Child/>`;
|
||||
static components = { Child };
|
||||
}
|
||||
await mount(Parent, fixture);
|
||||
});
|
||||
|
||||
test("can use component in default-content of t-slot", async () => {
|
||||
class GrandChild extends Component {
|
||||
static template = xml``;
|
||||
}
|
||||
class Child extends Component {
|
||||
static template = xml`<t t-slot="default"><GrandChild/></t>`;
|
||||
static components = { GrandChild };
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`<Child/>`;
|
||||
static components = { Child };
|
||||
}
|
||||
await mount(Parent, fixture);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user