use umb router slot in main

This commit is contained in:
Mads Rasmussen
2023-02-01 14:34:36 +01:00
parent 69bd4eedfa
commit 07a180e932

View File

@@ -44,15 +44,18 @@ export class UmbBackofficeMain extends UmbLitElement {
this._backofficeContext = _instance;
this._observeBackoffice();
});
}
private async _observeBackoffice() {
if(this._backofficeContext) {
this.observe(this._backofficeContext.getAllowedSections(), (sections) => {
this._sections = sections;
this._createRoutes();
}, 'observeAllowedSections');
if (this._backofficeContext) {
this.observe(
this._backofficeContext.getAllowedSections(),
(sections) => {
this._sections = sections;
this._createRoutes();
},
'observeAllowedSections'
);
}
}
@@ -94,7 +97,7 @@ export class UmbBackofficeMain extends UmbLitElement {
}
render() {
return html`<router-slot .routes=${this._routes}></router-slot>`;
return html`<umb-router-slot .routes=${this._routes}></umb-router-slot>`;
}
}