mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
refactoring on types
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Widget from "../core/Widget";
|
||||
import Widget from "../core/widget";
|
||||
import { Env } from "../types";
|
||||
|
||||
const template = `
|
||||
<div>
|
||||
@@ -8,14 +9,14 @@ const template = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
export default class Counter extends Widget {
|
||||
export default class Counter extends Widget<Env> {
|
||||
name = "counter";
|
||||
template = template;
|
||||
state = {
|
||||
counter: 0
|
||||
};
|
||||
|
||||
constructor(parent: Widget | null, props: {initialState?: number}) {
|
||||
constructor(parent: Widget<Env>, props: {initialState?: number}) {
|
||||
super(parent);
|
||||
this.state.counter = props.initialState || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user