実装(処理)
import style from './style.scss';
import html from './template.html';
const template = document.createElement('template');
template.innerHTML = `<style>${style}</style>${html}`;
export class SmaregiHeader extends HTMLElement {
static get observedAttributes() {
return [
'is-support',
]
}
constructor() {
super();
this.attachShadow({mode: 'open'});
this.shadowRoot.appendChild(template.content.cloneNode(true));
this._navMenu = this.shadowRoot.querySelector('#GlobalNavMenu');
this._isSupport = false;
}
connectedCallback() {
document.addEventListener('click', (event) => {
});
}
async attributeChangedCallback(name, oldValue, newValue) {
newValue = this.isJson(newValue) ? JSON.parse(newValue) : newValue;
}
isJson(value) {
}
}
リファレンスはこれを見たほうがいい。APIなどは少ないため障壁は低めだと思う。