wcb/examples/demo/Counter.mjs
2024-12-19 22:43:12 +01:00

17 lines
349 B
JavaScript

// @ts-check
import { WebComponent, html } from '../../src/index.js'
export class Counter extends WebComponent {
static props = {
count: 0,
}
get template() {
return html`
<button onClick=${() => ++this.props.count} id="btn">
${this.props.count}
</button>
`
}
}
customElements.define('my-counter', Counter)