summaryrefslogtreecommitdiff
path: root/examples/framework-multiple/src
diff options
context:
space:
mode:
authorGravatar Rafid Muhymin Wafi <rafidmuhymin@gmail.com> 2022-02-14 22:08:04 +0600
committerGravatar GitHub <noreply@github.com> 2022-02-14 22:08:04 +0600
commit61f438fdcbab7163bc3399e623a80d283e018371 (patch)
tree70458c77cda99715d05b9a036a02d766ea5f9569 /examples/framework-multiple/src
parentd107b04c423ed3521ebaba1edbd08994666a4935 (diff)
downloadastro-61f438fdcbab7163bc3399e623a80d283e018371.tar.gz
astro-61f438fdcbab7163bc3399e623a80d283e018371.tar.zst
astro-61f438fdcbab7163bc3399e623a80d283e018371.zip
Added LitCounter.js
Diffstat (limited to 'examples/framework-multiple/src')
-rw-r--r--examples/framework-multiple/src/components/LitCounter.js33
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);