v1
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user