webcomponent
Version:
lightweight helpers for constructing web components
26 lines (20 loc) • 465 B
JavaScript
import WebComponent from '../lib';
export default class TestWidget extends WebComponent {
constructor() {
super();
this.constructed = true;
}
connectedCallback() {
this.innerHTML = `Hello world`;
this.connected = true;
}
disconnectedCallback() {
this.disconnected = true;
}
static get observedAttributes() {
return [`foo`];
}
attributeChangedCallback(name, oldValue, newValue) {
this.lastAttrChanged = name;
}
}