diff options
Diffstat (limited to 'examples/framework-multiple/src/components/LitCounter.js')
-rw-r--r-- | examples/framework-multiple/src/components/LitCounter.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/framework-multiple/src/components/LitCounter.js b/examples/framework-multiple/src/components/LitCounter.js new file mode 100644 index 000000000..883a7581d --- /dev/null +++ b/examples/framework-multiple/src/components/LitCounter.js @@ -0,0 +1,33 @@ +import { LitElement, html } from 'lit'; + +export const tagName = 'my-counter'; + +class Counter extends LitElement { + static get properties() { + return { + count: { + type: Number, + }, + }; + } + + constructor() { + super(); + this.count = 0; + } + + increment() { + this.count++; + } + + render() { + return html` + <div> + <p>Count: ${this.count}</p> + <button type="button" @click=${this.increment}>Increment</button> + </div> + `; + } +} + +customElements.define(tagName, Counter); |