Closed
Description
Javascript version could just be:
import {html, css, LitElement} from 'lit';
export class SimpleGreeting extends LitElement {
static styles = css`p { color: blue }`;
static properties = {
name: {type: String}
}
constructor() {
super();
this.name = 'Somebody';
}
render() {
return html`<p>Hello, ${this.name}!</p>`;
}
}
customElements.define('simple-greeting', SimpleGreeting);
Styles and properties don't need to be getter functions, do they? This saves 4 lines and looks a bit nicer.
I get that it's still not as nice as the TS version without decorators, but no need to make it more long-winded than it needs to be.
Metadata
Metadata
Assignees
Labels
No labels