[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:
Géry Debongnie
2019-04-14 10:44:29 +02:00
parent d7bed96667
commit 3733734ae5
3 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -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 {