angular 重定向路由

const routes: Routes = [
  {
    path: '',
    redirectTo: '/home',
    pathMatch: 'full'
  },
  {
    path: 'home',
    component: HomeComponent
  },
  {
    path: 'product/:id',
    component: ProductComponent
  }
  ,
  {
    path: '**',
    component: Code404Component
  }
];

猜你喜欢

转载自www.cnblogs.com/chenyishi/p/8903618.html