wcb/examples/props-blueprint/index.js
2024-12-19 22:43:12 +01:00

14 lines
322 B
JavaScript

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