Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lit-element and lit-element-ts templates #1684

Closed
g7alt opened this issue Jan 24, 2021 · 1 comment
Closed

lit-element and lit-element-ts templates #1684

g7alt opened this issue Jan 24, 2021 · 1 comment

Comments

@g7alt
Copy link

g7alt commented Jan 24, 2021

Could you add lit-element and lit-element-ts template presets?

@yyx990803
Copy link
Member

yyx990803 commented Jan 25, 2021

Does lit-element really need a template? Like, this is all you need:

npm install -D vite
npm install lit-element

index.html

<script type="module" src="/main.ts"></script>
<my-element></my-element>

main.ts

import {LitElement, html, customElement, property} from 'lit-element';

@customElement('my-element')
class MyElement extends LitElement {

 // Declare observed properties
 @property()
 adjective = 'awesome';

 // Define the element's template
 render() {
   return html`<p>your ${this.adjective} template here</p>`;
 }
}

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants