同一个组件有多个路由,router-outlet 完美更新。默认情况下未加载图表,单击侧边栏时也不会最小化
但是当我刷新 url 时,只有仪表板图会加载?这是为什么?
我的主页.html:
<div class="nav-commands">
<a [routerLink]="['home/dashboard']">People</a>
<a [routerLink]="['home/second']">Second</a>
<a [routerLink]="['home/third']">third</a>
<a [routerLink]="['home/forth']">forth</a>
<a [routerLink]="['home/fifth']">fifth</a>
</div>
</div>
<div class="contenttext">
<router-outlet></router-outlet>
</div>
我的 app.route.module.ts:
{ path: 'home', component: HomeComponent,
children:[
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent,},
{ path: 'second', component: SecondComponent,},
{ path: 'third', component: ThirdComponent,},
{ path: 'fourth', component: FourthComponent,},
{ path: 'fifth', component: FifthTaskComponent,},
]}