diff options
| author | 2022-02-14 22:08:04 +0600 | |
|---|---|---|
| committer | 2022-02-14 22:08:04 +0600 | |
| commit | 61f438fdcbab7163bc3399e623a80d283e018371 (patch) | |
| tree | 70458c77cda99715d05b9a036a02d766ea5f9569 /examples/framework-multiple/src/components | |
| parent | d107b04c423ed3521ebaba1edbd08994666a4935 (diff) | |
| download | astro-61f438fdcbab7163bc3399e623a80d283e018371.tar.gz astro-61f438fdcbab7163bc3399e623a80d283e018371.tar.zst astro-61f438fdcbab7163bc3399e623a80d283e018371.zip | |
Added LitCounter.js
Diffstat (limited to 'examples/framework-multiple/src/components')
| -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); | 
