mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] component: rename t-keep-alive to t-keepalive
This is useful to preserve the following nice property: when we have an attribute t-something-someotherthing, we can get the directive name by removing 't-' at the front, and splitting on '-'.
This commit is contained in:
@@ -739,10 +739,10 @@ describe("composition", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("sub widgets with t-keep-alive are not destroyed if no longer in dom", async () => {
|
||||
test("sub widgets with t-keepalive are not destroyed if no longer in dom", async () => {
|
||||
class ParentWidget extends Widget {
|
||||
state = { ok: true };
|
||||
inlineTemplate = `<div><t t-if="state.ok"><t t-widget="counter" t-keep-alive="1"/></t></div>`;
|
||||
inlineTemplate = `<div><t t-if="state.ok"><t t-widget="counter" t-keepalive="1"/></t></div>`;
|
||||
widgets = { counter: Counter };
|
||||
}
|
||||
const widget = new ParentWidget(env);
|
||||
@@ -765,10 +765,10 @@ describe("composition", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("sub widgets dom state with t-keep-alive is preserved", async () => {
|
||||
test("sub widgets dom state with t-keepalive is preserved", async () => {
|
||||
class ParentWidget extends Widget {
|
||||
state = { ok: true };
|
||||
inlineTemplate = `<div><t t-if="state.ok"><t t-widget="InputWidget" t-keep-alive="1"/></t></div>`;
|
||||
inlineTemplate = `<div><t t-if="state.ok"><t t-widget="InputWidget" t-keepalive="1"/></t></div>`;
|
||||
widgets = { InputWidget };
|
||||
}
|
||||
class InputWidget extends Widget {
|
||||
|
||||
Reference in New Issue
Block a user