wcb/examples/templating/index.js
Ayo b4f3b98ee4 feat: use standard event prop behavior
- call .toLowerCase() on attribute props
2023-12-09 00:15:39 +01:00

16 lines
393 B
JavaScript

import { WebComponent, html } from "../../src/index.js";
export class Counter extends WebComponent {
static props = {
count: 123,
};
get template() {
return html`
<button onClick=${() => ++this.props.count} style="background-color: black; color: white;">
<span>${this.props.count}</span>
</button>
`;
}
}
customElements.define("my-counter", Counter);