32 lines
532 B
JavaScript
32 lines
532 B
JavaScript
import { html, Component, live } from 'wkit'
|
|
|
|
class App extends Component {
|
|
foo = ''
|
|
|
|
bar = { a: 333 }
|
|
|
|
created() {
|
|
// live = live.bind(this)
|
|
}
|
|
|
|
reset() {
|
|
this.foo = ''
|
|
this.bar.a = '666'
|
|
this.$requestUpdate()
|
|
}
|
|
|
|
render() {
|
|
return html`
|
|
<p>${this.foo}</p>
|
|
<p>${this.bar.a}</p>
|
|
<input value=${live.bind(this, 'bar.a')} />
|
|
<input value=${this.foo} />
|
|
<input value=${live.bind(this, 'foo')} />
|
|
|
|
<button @click=${this.reset}>666</button>
|
|
`
|
|
}
|
|
}
|
|
|
|
App.reg('app')
|
JavaScript
97%
HTML
3%