IRoutingInfo

This commit is contained in:
Niels Lyngsø
2022-12-20 16:22:26 +01:00
parent fe536ae047
commit 5365796b7e
2 changed files with 3 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ import type { ManifestTree, ManifestSectionView, ManifestWorkspace } from '@umbr
import './section-trees/section-trees.element.ts';
import '../shared/section-views/section-views.element.ts';
import { umbExtensionsRegistry } from '@umbraco-cms/extensions-registry';
import { IRoutingInfo } from 'router-slot';
@customElement('umb-section')
@@ -95,7 +96,7 @@ export class UmbSectionElement extends UmbContextConsumerMixin(UmbObserverMixin(
routes.push({
path: `${workspace.meta.entityType}/:key`,
component: () => createExtensionElement(workspace),
setup: (component: Promise<HTMLElement>, info: any) => {
setup: (component: Promise<HTMLElement>, info: IRoutingInfo) => {
component.then((el: HTMLElement) => {
(el as any).entityKey = info.match.params.key;
})

View File

@@ -72,7 +72,7 @@ export class UmbSectionViewUsersElement extends UmbContextProviderMixin(
routes.push({
path: `${workspace.meta.entityType}/:key`,
component: () => createExtensionElement(workspace),
setup: (component: Promise<HTMLElement>, info: any) => {
setup: (component: Promise<HTMLElement>, info: IRoutingInfo) => {
component.then((el: HTMLElement) => {
(el as any).entityKey = info.match.params.key;
})