fix(core): update

This commit is contained in:
2020-07-15 21:00:47 +00:00
parent 0ce9a96b90
commit 08d92d9d3e
2 changed files with 19 additions and 17 deletions

View File

@ -37,19 +37,6 @@ export class WccDashboard extends LitElement {
if (pagesArg) {
this.pages = pagesArg;
}
this.init();
}
public async init() {
this.domtools = await plugins.deesDomtools.DomTools.setupDomTools();
this.domtools.router.on('/elements/:elementName', async routeInfo => {
this.selectedItem = this.elements[routeInfo.params.elementName];
});
this.domtools.router.on('/pages/:pageName', async routeInfo => {
this.selectedItem = this.pages[routeInfo.params.pageName];
});
this.domtools.router._handleRouteState();
}
public render(): TemplateResult {
@ -122,4 +109,16 @@ export class WccDashboard extends LitElement {
}, 0);
}
}
public async firstUpdated() {
this.domtools = await plugins.deesDomtools.DomTools.setupDomTools();
this.domtools.router.on('/elements/:elementName', async routeInfo => {
this.selectedItem = this.elements[routeInfo.params.elementName];
});
this.domtools.router.on('/pages/:pageName', async routeInfo => {
this.selectedItem = this.pages[routeInfo.params.pageName];
});
this.domtools.router._handleRouteState();
}
}