i added custom Component on page, this is my code:
class PostUnion extends Component {
oninit(vnode) {
super.oninit(vnode);
this.count = 1
}
increment() {
console.log('click')
this.count++
m.redraw();
}
view() {
return (<div>
Count: {this.count}
<button onclick={this.increment.bind(this)}>
click
</button>
</div>);
}
}
now, i clicked button,i can see console output 'click', but the view function count not redraw,can some one tell me why and how to make right?thank you