use custom elements for application layout

This commit is contained in:
Fran Jurmanović
2021-05-31 14:23:13 +02:00
parent e1ab0e51d6
commit e065efc499
9 changed files with 110 additions and 15 deletions

View File

@@ -37,15 +37,15 @@ class MenuLayoutElement extends BaseLayoutElement {
html`<div>
<app-link data-go-back="true" data-title="Go back"></app-link>
</div>`}
<div data-target="menu-layout.slotted"></div>
<app-slot data-target="menu-layout.appSlot"></app-slot>
`;
}
update = () => {
render(this.render(), this);
const _slotted = this._slotted;
if (_slotted && this.slotted) {
this.slotted.innerHTML = _slotted;
const _appSlot = this._appSlot;
if (_appSlot && this.appSlot) {
this.appSlot.innerHTML = _appSlot;
}
};
}