tabs.routes.ts 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { TabsPage } from './tabs.page';
  2. import { NgModule } from '@angular/core';
  3. import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
  4. export const routes: Routes = [
  5. {
  6. path: 'tabs',
  7. component: TabsPage,
  8. children: [
  9. {
  10. path: 'tab1',
  11. loadComponent: () =>
  12. import('../tab1/tab1.page').then((m) => m.Tab1Page),
  13. },
  14. {
  15. path: 'tab2',
  16. loadComponent: () =>
  17. import('../tab2/tab2.page').then((m) => m.Tab2Page),
  18. },
  19. {
  20. path: 'tab3',
  21. loadComponent: () =>
  22. import('../tab3/tab3.page').then((m) => m.Tab3Page),
  23. },
  24. {
  25. path: 'tab4',
  26. loadComponent: () =>
  27. import('../tab4/tab4.page').then((m) => m.Tab4Page),
  28. },
  29. {
  30. path: 'picture',
  31. loadComponent: () =>
  32. import('../poem-picture/poem-picture.component').then((m) => m.PoemPictureComponent),
  33. },
  34. {
  35. path: 'inquiry/ai',
  36. loadComponent: () =>
  37. import('../page/page-inquiry/page-inquiry.component').then((m) => m.PageInquiryComponent),
  38. },
  39. {
  40. path: 'inquiry/human',
  41. loadComponent: () =>
  42. import('../page/inquiry-human/inquiry-human.component').then((m) => m.InquiryHumanComponent),
  43. },
  44. {
  45. path: 'page-test',
  46. loadComponent: () =>
  47. import('../page-test/page-test.component').then((m) => m.PageTestComponent),
  48. },
  49. {
  50. path: 'my-health', // 我的健康
  51. loadComponent: () =>
  52. import('../page/page-my-health/page-my-health.component').then((m) => m.PageMyHealthComponent),
  53. },
  54. {
  55. path: 'drug-category/:name',
  56. loadComponent: () =>
  57. import('../drug-category/drug-category.page').then(
  58. (m) => m.DrugCategoryPage
  59. ),
  60. },
  61. {
  62. path: 'ai-knowledge',
  63. loadComponent: () =>
  64. import('../page/page-ai-knowledge/page-ai-knowledge.component').then(
  65. (m) => m.PageAiKnowledgeComponent
  66. ),
  67. },
  68. {
  69. path: 'create-agent',
  70. loadComponent: () =>
  71. import('../page/page-create-agent/page-create-agent.component').then(
  72. (m) => m.PageCreateAgentComponent
  73. ),
  74. },
  75. {
  76. path: '',
  77. redirectTo: '/tabs/tab4',
  78. pathMatch: 'full'
  79. },
  80. ],
  81. },
  82. {
  83. path: '',
  84. redirectTo: '/tabs/tab4',
  85. pathMatch: 'full'
  86. }
  87. ];
  88. @NgModule({
  89. imports: [
  90. RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  91. ],
  92. exports: [RouterModule]
  93. })
  94. export class AppRoutingModule { }