我希望在其他/ parent / child旁边有一个像/ parent /:id这样的动态路由。
我试过这样的事情没有成功:
export const routes: RouterConfig = [
{ path: '', component: HomeComponent },
{ path: 'parent', component: ParentComponent,canActivate: [ WebpackAsyncRoute ],
children: [
{ path: ':id', component: 'ParamComponent' },
{ path: 'child', component: 'ChildComponent' },
{ path: 'anotherchild', component: 'AnotherChildComponent' }
]
}
];
答案 0 :(得分:0)
答案是肯定的。问题是我没有在组件上定义的路由配置上添加:id路径(因为我正在使用WebpackAsyncRoute)。所以没有任何与通配符路径相关的内容