##// END OF EJS Templates
added djbase mixins declaration support
added djbase mixins declaration support

File last commit:

r30:a46488b209e8 v1.0.0-rc14 default
r32:1174538197f6 v1.0.0-rc15 default
Show More
MyWidget.tsx
43 lines | 969 B | text/x-typescript | TypeScriptLexer
cin
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods
r30 import { djbase, djclass, bind, prototype, AbstractConstructor } from "../declare";
cin
fixed strict mode @bind decorator
r28
import { DjxWidgetBase } from "../tsx/DjxWidgetBase";
import { createElement } from "../tsx";
cin
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods
r30 interface MyWidgetAttrs {
title: string;
counter: number;
}
interface MyWidgetEvents {
"count-inc": Event;
"count-dec": Event;
}
cin
fixed strict mode @bind decorator
r28
@djclass
cin
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods
r30 export class MyWidget extends djbase(DjxWidgetBase as AbstractConstructor<DjxWidgetBase<MyWidgetAttrs, MyWidgetEvents>>) {
cin
fixed strict mode @bind decorator
r28
@bind({node: "titleNode", type:"innerHTML"})
title = "";
@prototype()
counter = 0;
render() {
return <div>
<h1 data-dojo-attach-point="titleNode"></h1>
cin
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods
r30 <span onclick={() => this._onIncClick()}>[+]</span>
<span onclick={() => this._onDecClick()}>[-]</span>
cin
fixed strict mode @bind decorator
r28 </div>;
}
cin
Added 'Attrs', 'Events' type parameters to DjxWidgetBase, typed 'on' and 'emit' methods
r30 _onIncClick() {
this.emit("count-inc", { bubbles: false } );
}
_onDecClick() {
this.emit("count-dec", { bubbles: false } );
}
cin
fixed strict mode @bind decorator
r28 }