如果父路徑沒有像下面示例中的任何組件(哪個組件將呈現ScheduleListComponent
組件),則使用哪個組件顯示子組件。
const routes: Routes = [
{
path: '',
children: [
{ path: '', component: ScheduleListComponent },
{ path: 'function/:id', component: ScheduleFunctionComponent },
{ path: 'schedules/:id', component: ScheduleComponent },
]
}
];
uj5u.com熱心網友回復:
由于沒有與它關聯的組件,它將在父路由器出口中呈現,通常這種模式稱為無組件路由。
無組件路由“使用” URL 段而不實體化組件。
現在,當導航到“/function/1”時,路由器將創建以下組件樹:
AppComponent -> ScheduleFunctionComponent
了解更多資訊
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/532572.html
標籤:有角度的
下一篇:如何從超類方法呼叫基類方法