-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c692a0d
commit a2cec0e
Showing
7 changed files
with
3,585 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {html, render} from 'lit-html'; | ||
|
||
// This is a lit-html template function. It returns a lit-html template. | ||
const helloTemplate = (name) => html`<div>Hello ${name}!</div>`; | ||
|
||
// This renders <div>Hello Steve!</div> to the document body | ||
render(helloTemplate('Steve'), document.body); | ||
|
||
// This updates to <div>Hello Kevin!</div>, but only updates the ${name} part | ||
render(helloTemplate('Kevin'), document.body); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class HelloWorld extends HTMLElement{ | ||
|
||
constructor(){ | ||
super(); | ||
// this.attachShadow({mode:'open'}); | ||
this.render(); | ||
} | ||
|
||
render() { | ||
const t = document.createElement('div'); | ||
t.innerHTML = 'hello world'; | ||
|
||
// this.shadowRoot.appenChild(t); | ||
this.appendChild(t); | ||
} | ||
}; | ||
window.customElements.define("hello-wold", HelloWorld); | ||
|
||
export HelloWorld; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const app = {}; | ||
|
||
export app; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<title>SPA</title> | ||
<link rel="stylesheet" type="text/css" href="style.css" /> | ||
</head> | ||
|
||
<body> | ||
|
||
<main id="app"> | ||
<hello-wold></hello-wold> | ||
<hello-template></hello-template> | ||
</main> | ||
|
||
<script src="app.js" type="module"></script> | ||
<script src="HelloWorld.js" type="module"></script> | ||
<script src="HelloTemplate.js" type="module"></script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.