tabs.modules.routes.ts 547 B

123456789101112131415161718192021222324
  1. import { NgModule } from '@angular/core';
  2. import { RouterModule, Routes } from '@angular/router';
  3. import { HomeComponent } from './home/home.component';
  4. import { MyComponent } from './my/my.component';
  5. const routes: Routes = [
  6. {
  7. path: '',
  8. redirectTo:'home',
  9. pathMatch: "full",
  10. },
  11. {
  12. path: 'home', //首页
  13. component: HomeComponent,
  14. },
  15. {
  16. path: 'my', //我的
  17. component: MyComponent,
  18. },
  19. ]
  20. @NgModule({
  21. imports: [RouterModule.forChild(routes)],
  22. exports: [RouterModule],
  23. })
  24. export class TabsRoutingModule { }