wcb/components/HelloWorld.mjs
2023-09-16 23:08:52 +02:00

20 lines
403 B
JavaScript

// @ts-check
import { WebComponent } from "./WebComponent.mjs";
export class HelloWorld extends WebComponent {
name = "World";
emotion = "excited";
static get observedAttributes() {
return ["name", "emotion"];
}
get template() {
return `
<h1>Hello ${this.name}${
this.emotion === 'sad'
? '. 😭'
: '! 🙌'
}</h1>`
}
}