27 lines
684 B
HTML
27 lines
684 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>WC Base Test</title>
|
|
<script type="module">
|
|
import { WebComponent } from "./src/WebComponent.js";
|
|
|
|
class HelloWorld extends WebComponent {
|
|
static properties = ["my-name"];
|
|
get template() {
|
|
return `<h1>Hello ${this.props.myName}!</h1>`;
|
|
}
|
|
}
|
|
|
|
customElements.define("hello-world", HelloWorld);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<hello-world my-name="Ayo"></hello-world>
|
|
<script>
|
|
const helloWorld = document.querySelector("hello-world");
|
|
setTimeout(() => {
|
|
helloWorld.props.myName = "Ayo zzzZzzz";
|
|
}, 2500);
|
|
</script>
|
|
</body>
|
|
</html>
|