这是根路由模块
const routes: Routes = [
{ path: '', redirectTo: '/main', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent }
];
这是main子路由模块
const routes: Routes = [
{ path: 'main',
children: [
{ path: 'chat', component: ChatComponent, outlet: 'chat' },
{ path: 'summary', component: SummaryComponent },
{ path: 'contact', component: ContactComponent },
{ path: 'me', component: MeComponent },
{ path: '', redirectTo: 'summary', pathMatch: 'full' }
]
}
];
当打开初始页面时,路由只定向到了/main,并不是/main/summary,是不支持这样写吗?