我用角形路由器制作了一个选项卡视图,但是当我单击一个选项卡项目时,我遇到了一个问题,它显示了路线,但是我再也看不到选项卡了。如果我卸下路由器插座,它仍然可以工作,但仍然看不到选项卡。有人知道吗?我看到一些在路由模块中使用插座的解决方案,并为路由器插座添加名称,但显示无法匹配任何路由...
我的根路径:
const dashboardRoutes: Routes = [
{
path: '',
component: DashboardComponent,
children: [
{
path: '',
pathMatch: 'full',
children: [
{
path: 'orders',
redirectTo: 'orders'
},
]
},
{
path: 'orders',
loadChildren: './orders/orders.module#OrderModule'
},
]
}
];
我的订单路线模块:
const orderRoutes: Routes = [
{
path: '',
component: OrdersComponent
},
{
path: 'orderconfirmed',
component: OrderconfirmedComponent
},
{
path: 'orderoutfordelivery',
component: OrderOutForDeliveryComponent
},
{
path: 'orderdelivered',
component: OrderDeliveredComponent
},
{
path: 'ordercanceled',
component: OrderCanceledComponent
},
{
path: 'all',
component: OrderAllComponent
}
];
在我的订单组件中。如果我评论router-outlet,它仍然可以工作,但是看不到tab:
<div class="row">
<div class="col-xs-12">
<app-ordertab></app-ordertab>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<!-- <router-outlet></router-outlet> -->
</div>
</div>