-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (38 loc) · 1.14 KB
/
Copy pathindex.html
File metadata and controls
41 lines (38 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!doctype html>
<html>
<head>
<script defer src="https://unpkg.com/es-module-shims@latest/dist/es-module-shims.js"></script>
<script type="importmap-shim">
{
"imports": {
"lit-html": "https://unpkg.com/lit-html@latest/lit-html.js?module",
"lit-element": "https://unpkg.com/lit-element@latest/lit-element.js?module",
"lit-html/lit-html.js": "https://unpkg.com/lit-html@latest/lit-html.js?module",
"lit-html/lib/shady-render.js": "https://unpkg.com/lit-html@latest/lib/shady-render.js?module"
}
}
</script>
<script type="module-shim">
// you can also set a script src with type "module-shim"
import { LitElement, html, css } from 'lit-element';
class XComponent extends LitElement {
static get styles() {
return css`
:host {
color: red;
}
`;
}
render() {
return html`
Hello from lit-element!
`;
}
}
customElements.define('x-component', XComponent);
</script>
</head>
<body>
<x-component></x-component>
</body>
</html>