@todojs/

06-lit-html

HTML, CSS, JS

No description

fork
loading
Files
  • index.html

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8580222980313421","path":"index.html","file":{"path":"index.html","content":{"asEncoding":{"base64":"PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0iVVRGLTgiPgogIDx0aXRsZT5UZW1wbGF0ZTwvdGl0bGU+CjwvaGVhZD4KPGJvZHk+CjxidXR0b24+Q2hhbmdlPC9idXR0b24+CjxkaXYgaWQ9InJlc3VsdCI+PC9kaXY+CjxzY3JpcHQgdHlwZT0ibW9kdWxlIj4KICBpbXBvcnQgeyBodG1sLCByZW5kZXIgfSBmcm9tICdodHRwczovL3VucGtnLmNvbS9saXQtaHRtbD9tb2R1bGUnOwoKICBsZXQgc2F5SGVsbG8gPSAobmFtZSkgPT4gaHRtbGA8aDE+SGVsbG8gJHsgbmFtZSB9PC9oMT5gOwogIHJlbmRlciAoc2F5SGVsbG8gKCdXb3JsZCcpLCBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcmVzdWx0JykpOwoKICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdidXR0b24nKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsICgpID0+IHsKICAgIHJlbmRlciAoc2F5SGVsbG8gKCdFdmVyeW9uZScpLCBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcmVzdWx0JykpOwogIH0pOwo8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Template</title>
</head>
<body>
<button>Change</button>
<div id="result"></div>
<script type="module">
  import { html, render } from 'https://unpkg.com/lit-html?module';

  let sayHello = (name) => html`<h1>Hello ${ name }</h1>`;
  render (sayHello ('World'), document.querySelector('#result'));

  document.querySelector('button').addEventListener('click', () => {
    render (sayHello ('Everyone'), document.querySelector('#result'));
  });
</script>
</body>
</html>
result
console