wcb/examples/templating/index.js
2023-12-08 22:40:27 +01:00

16 lines
340 B
JavaScript

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