我已经为我的垫侧导航生成了新的组件,但是当我尝试使用路由器出口将某些内容路由到侧栏内容时,我试图路由到侧栏的组件覆盖侧页,并且在完整的页面上。
我不知道是不是有什么问题的组成部分,我有我的侧导航或其他东西。
发布于 2022-03-25 14:35:51
尝尝这个
<app-header *ngIf="connected"></app-header>
<mat-sidenav-container>
<mat-sidenav style="width: 15%" [opened]="open" [mode]="'side'">
<mat-nav-list>
<app-list-navigation></app-list-navigation>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav-content>
<div style="height: 90vh">
<router-outlet></router-outlet>
</div>
</mat-sidenav-content>
</mat-sidenav-container>
<app-footer *ngIf="connected"></app-footer>
确保组件位于主模块的主模块或子模块中。
https://stackoverflow.com/questions/71621717
复制相似问题