Last active
March 17, 2020 20:02
-
-
Save deebloo/4a38c7311d56455fdba9b43e72498b33 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>My Element</title> | |
</head> | |
<body> | |
<script type="module"> | |
import { html, render } from 'https://unpkg.com/lit-html?module'; | |
class MyElement extends HTMLElement { | |
greeting: string = 'Hello World'; | |
attachedCallback() { | |
this.render(); | |
} | |
render() { | |
render(html`${this.greeting}`) | |
} | |
} | |
customElements.define('my-element', MyElement); | |
</script> | |
<my-element></my-element> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment