Last active
July 4, 2020 21:20
-
-
Save MatthiasKainer/ef075d9c0200964351b1c0a4392b9772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
LitElement, | |
customElement, | |
html, | |
css, | |
property | |
} from "lit-element"; | |
const blockStyle = css`:host { display: block; }` | |
@customElement("hello-world") | |
export class HelloWorld extends LitElement { | |
@property() | |
who: string = "noone"; | |
static get styles() { | |
return [blockStyle]; | |
} | |
render() { | |
return html` | |
Hello ${this.who}! | |
`; | |
} | |
} | |
@customElement("greet-em") | |
export class GreetEm extends LitElement { | |
render() { | |
return html` | |
<div> | |
${["george", "john"].map( | |
n => | |
html` | |
<hello-world who="${n}"></hello-world> | |
` | |
)} | |
</div> | |
`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment