fix(core): update

This commit is contained in:
2020-11-27 16:40:38 +00:00
parent 64d6379cd2
commit 46e0b9f9db
4 changed files with 35 additions and 16 deletions

View File

@ -98,9 +98,14 @@ export class WccDashboard extends LitElement {
></wcc-properties>
<wcc-frame id="wccFrame" viewport=${this.selectedViewport}>
${(() => {
if (this.selectedType === 'page') {
return this.selectedItem();
} else if (this.selectedItem) {
if (this.selectedType === 'page' && this.selectedItem) {
if (typeof this.selectedItem === 'function') {
return this.selectedItem();
} else {
console.error('The selected item looks strange:')
console.log(this.selectedItem);
}
} else if (this.selectedType === 'element' && this.selectedItem) {
// console.log(this.selectedItem);
const anonItem: any = this.selectedItem;
if (!anonItem.demo) {
@ -139,7 +144,7 @@ export class WccDashboard extends LitElement {
this.selectedItem = this.elements[routeInfo.params.itemName];
} else if (routeInfo.params.itemType === 'page') {
this.selectedType = 'page';
this.selectedItem = this.pages[routeInfo.params.pageName];
this.selectedItem = this.pages[routeInfo.params.itemName];
}
const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup();
domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport);
@ -173,8 +178,7 @@ export class WccDashboard extends LitElement {
this.domtools.router.pushUrl(
`/${this.selectedType}/${this.selectedItemName}/${this.selectedViewport}/${
this.selectedTheme
}`,
0
}`
);
}
}