app-routing.module.ts 788 B

1234567891011121314151617181920212223242526272829
  1. import { NgModule } from '@angular/core';
  2. import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
  3. const routes: Routes = [
  4. {
  5. path: '',
  6. loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  7. },
  8. {
  9. path: 'detail',
  10. loadChildren: () => import('./detail-page/detail-page.module').then( m => m.DetailPagePageModule)
  11. },
  12. {
  13. path: 'login',
  14. loadChildren: () => import('./login/login.module').then(m => m.LoginPageModule)
  15. },
  16. // 添加:
  17. {
  18. path: 'user',
  19. loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
  20. }
  21. ];
  22. @NgModule({
  23. imports: [
  24. RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  25. ],
  26. exports: [RouterModule]
  27. })
  28. export class AppRoutingModule {}