1234567891011121314151617181920212223242526272829303132 |
- import {LitElement, html, css} from 'lit-element';
- import {customElement, property} from 'lit/decorators.js';
- @customElement('click-counter')
- export class ClickCounter extends LitElement {
- static styles = css`
- :host {
- display: block;
- }
- `;
- @property({type: Number})
- count = 0;
- render() {
- return html`
- <button @click=${this._onClick}>
- Click count: ${this.count}
- </button>
- `;
- }
- private _onClick() {
- this.count++;
- }
- }
- declare global {
- interface HTMLElementTagNameMap {
- 'click-counter': ClickCounter;
- }
- }
|