do not destroy and rerender sub widgets if not necessary

add failing test on rerendering sub widgets...
This commit is contained in:
Géry Debongnie
2019-01-27 22:16:00 +01:00
parent 9e0d1db8e4
commit 851d01b7ad
4 changed files with 60 additions and 14 deletions
+1 -6
View File
@@ -56,10 +56,5 @@ export class Discuss extends Widget<Env> {
class ColorWidget extends Widget<Env> {
name = "colorwidget";
template = `<div>Current Color: <t t-esc="state.color"/></div>`;
state: { color: "red" | "blue" };
constructor(parent: Widget<Env>, props: { color: "red" | "blue" }) {
super(parent);
this.state = { color: props.color };
}
template = `<div>Current Color: <t t-esc="props.color"/></div>`;
}