jmn-basic-elements
Version:
A collection of HMI elements representing P&ID entities made with JS-HMI.
18 lines (15 loc) • 403 B
text/typescript
import {hmiElement,html} from "jahmin"
export class onclickToggle extends hmiElement {
constructor(){
super();
this.addEventListener("click", this.toggle.bind(this));
}
toggle(){
let toggle = this.value ? false : true;
this.Write(toggle);
}
render(){
return html`<slot></slot>`
}
}
customElements.define("onclick-toggle",onclickToggle);