我有<mat-sidenav-container>,我在<mat-sidenav-content>中使用<mat-sidenav>和<routeroutlet>进行导航
<mat-sidenav-content class="body-sidenav">
<router-outlet></router-outlet>
</mat-sidenav-content>这是很好的工作
我的路由器
{
path: 'article-section',
component: AllSectionComponent,
children: [
{
path: 'article-section/:id',
component: ArticleComponent,
},
]},
我需要这个模板

因为我不确定,所以我需要AllSectionComponent中的下一个<routeroutlet>
就像这样
<router-outlet></router-outlet>
<div class="center-folder">
<div class="row">
<div *ngFor="let item of articleSection"
style="width: 100px; margin-right:10px; margin-left: 10px; margin-
bottom: 10px;">
<img class="img-section" src="assets/images/docimgaes/section.png" />
<br>
<a [routerLink]="['/article-section', 1]">
<div class="name-section">{{item.name}}</div>
</a>
</div>
</div>
</div>但在本例中,我在AllSectionComponent :)的头部打开了object的组件。我有两个html。我需要正常打开与<routeroutlet>,这是在<mat-sidenav-content>。我是否需要命名路由器插座,或者可能有更舒适的决定?
发布于 2019-07-17 04:27:11
我只需要它来改造我的路由器。
从这里开始
我的路由器来自这里
{
path: 'article-section',
component: AllSectionComponent,
children: [
{
path: 'article-section/:id',
component: ArticleComponent,
},
]到这个
{
path: 'article-section',
component: AllSectionComponent,
},
{
path: 'article-section/:id',
component: ArticleComponent,
},https://stackoverflow.com/questions/57059252
复制相似问题