当路由器是'/ account'时,如何导航到/ account / dashboard? 这是我的路线,目前无法正常工作。 正在加载的组件是AccountPage,而不是AccountDashboardPage?
export const routes = [
{ path: "", redirectTo: "home", pathMatch: "full" },
{ path: "home", component: HomePage },
{ path: "settings", component: SettingsPage },
{ path: "checkout", component: CheckoutPage },
{ path: "login", component: LoginPage },
{ path: "categories", component: CategoriesPage },
{ path: "category/subcategories/:id", component: SubcategoryList, pathMatch: "full" },
{ path: "category/:id", component: CategoryProducts, pathMatch: "full" },
{ path: "product/:id", component: ProductPage },
{
path: 'account',
component: AccountPage,
canActivateChild: [AuthGuardService],
children: [
{ path: "", redirectTo: 'dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: AccountDashboardPage}
]
}
];
答案 0 :(得分:0)
当我删除
component: AccountPage,
一切都成功了!