我想在刷新page.Before时重定向默认页面刷新页面我在这里http://localhost/mypage/#/brand,当我刷新页面时我想重定向http://localhost/mypage/#/home
const appRoutes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: Home },
{ path: 'brand', component: BrandCP },
];
export const appRoutingProviders: any[] = []
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true});
发布于 2016-09-16 12:51:21
当您访问此brand
页面时,使用诸如?redirect=1
之类的查询字符串。只需根据您的偏好附加重定向的值,然后在下次重新加载时根据您的喜好重新加载,然后在品牌的组件中,只需减少此重定向查询参数的值,如果该值未定义或设置为0,则让他停留在页面上,否则,如果设置为1,则将他重定向到主页Plain and simple
https://stackoverflow.com/questions/39523679
复制相似问题