Last active
October 1, 2018 05:53
-
-
Save newbornfrontender/bb83c6f134cfe531046485143c5578e4 to your computer and use it in GitHub Desktop.
Test Polymer and Lit Element
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> | |
<head> | |
<!-- Polyfills for Microsoft Edge and Firefox--> | |
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script> | |
<title>Test Polymer and Lit Element</title> | |
</head> | |
<body> | |
<script type="module"> | |
import { LitElement, html } from 'https://unpkg.com/@polymer/lit-element@latest/lit-element.js?module'; | |
class MyApp extends LitElement { | |
static get properties () { return { | |
msg: { | |
type: String, | |
}, | |
}}; | |
render () { return html` | |
<style> | |
span { | |
color: blue; | |
} | |
</style> | |
<h1>Hello <span>${this.msg}</span>!</h1> | |
`}; | |
}; | |
customElements.define('my-app', MyApp); | |
</script> | |
<my-app msg="world"></my-app> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment