wcb/examples/templating/index.js
Ayo 27a5fb3024 feat(templating): support for non on-event props
- use class or className
- only on-event props are tolowercase'd
2023-12-09 00:48:56 +01:00

16 lines
414 B
JavaScript

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