在更新到版本14之后,我得到了以下错误:
路由‘map/operator/’的无效配置:没有子或loadChildren的无组件路由不能有指定的出口集
这是我的路由器配置:
path: 'operator', component: HomeViewComponent, children: [
{ path: '', redirectTo: 'list/', outlet: 'alarms', pathMatch: 'full' },
{ path: 'list/:key', component: AlarmsListComponent, outlet: 'alarms' },
{ path: 'details/:keyType/:keyValue', component: AlarmDetailsComponent, outlet: 'alarms' }
]}
怎么能修好呢?
发布于 2022-06-12 13:30:44
我认为你应该如下所示:
const routes: Routes = [
{path: 'operator', component: HomeViewComponent,
outlet: 'alarms',
children: [
{ path: '', redirectTo: 'list/', pathMatch: 'full' },
{ path: 'list/:key', component: AlarmsListComponent },
{ path: 'details/:keyType/:keyValue', component: AlarmDetailsComponent }
]}
];https://stackoverflow.com/questions/72592266
复制相似问题