mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
widget: add t-key option, add better error handling
This commit is contained in:
@@ -22,6 +22,9 @@ const template = `
|
||||
<t t-widget="ColorWidget" t-props="{color: state.color}"/>
|
||||
<button t-on-click="addNotif(false)">Add notif</button>
|
||||
<button t-on-click="addNotif(true)">Add sticky notif</button>
|
||||
<t t-foreach="state.test" t-as="blip">
|
||||
<t t-widget="Counter" t-key="blip" t-props="{initialState: 100}"/>
|
||||
</t>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -29,7 +32,7 @@ export class Discuss extends Widget<Env, {}> {
|
||||
name = "discuss";
|
||||
template = template;
|
||||
widgets = { Clock, Counter, ColorWidget };
|
||||
state = { validcounter: true, color: "red" };
|
||||
state = { validcounter: true, color: "red", test: [1, 2, 3] };
|
||||
|
||||
mounted() {}
|
||||
resetCounter(ev: MouseEvent) {
|
||||
|
||||
Reference in New Issue
Block a user