From 61f438fdcbab7163bc3399e623a80d283e018371 Mon Sep 17 00:00:00 2001 From: Rafid Muhymin Wafi Date: Mon, 14 Feb 2022 22:08:04 +0600 Subject: [PATCH] Added LitCounter.js --- .../src/components/LitCounter.js | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 examples/framework-multiple/src/components/LitCounter.js diff --git a/examples/framework-multiple/src/components/LitCounter.js b/examples/framework-multiple/src/components/LitCounter.js new file mode 100644 index 0000000000..883a7581da --- /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` +
+

Count: ${this.count}

+ +
+ `; + } +} + +customElements.define(tagName, Counter);