mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
15 lines
314 B
Plaintext
15 lines
314 B
Plaintext
class {
|
|
onCreate(input) {
|
|
this.state = {
|
|
count: 0
|
|
}
|
|
}
|
|
handleClick() {
|
|
this.state.count++;
|
|
this.once('update', () => {
|
|
this.emit('change', this.state.count);
|
|
});
|
|
}
|
|
}
|
|
|
|
<button key="button" on-click('handleClick')>${state.count}</button> |