wcb/demo/BooleanPropTest.mjs
Ayo bef423fde1 feat: support boolean attribute
if no value is passed to an attribute it returns 'true'
2023-11-17 15:42:45 +01:00

17 lines
373 B
JavaScript

import WebComponent from "../src/WebComponent.js";
export class BooleanPropTest extends WebComponent {
isInline = false;
static properties = ["is-inline"];
onChanges(changes) {
console.log(">>> boolean prop test", changes);
}
get template() {
return `<span>${this.isInline}</span>`;
}
}
customElements.define("boolean-prop-test", BooleanPropTest);