Files
dernier-metro/lol/components/next-bus.js
T
2026-06-13 20:42:03 +02:00

34 lines
650 B
JavaScript

const TEMPLATE = document.createElement("template");
class NextBusElement extends HTMLElement {
#stop
get stopId(){
return this.#stop
}
set stopId(value){
this.#stop = value
this.updateContent()
}
connectedCallback(){
this.replaceChildren(TEMPLATE.content.cloneNode(true))
}
updateContent(){
}
static observedAttributes = ["stop-id"]
attributeChangedCallback(name, oldVal, newVal){
switch(name){
case "stop-id":
this.stopId = newVal
break;
}
}
}
customElements.define("camp-next-bus", NextBusElement);