Ionic 4如何从标签页导航到非标签页并保持标签?

ant*_*iff 5 tabs ionic-framework ionic4

在 Ionic 4 中,我有一个带有选项卡的应用程序(5 页主页、搜索、地图、信息、关税)从搜索页面导航到详细信息页面,但我想将选项卡菜单保留在详细信息页面上。不知道是否可以?

你如何配置路由?这是我的: app-routing.module.ts

`const routes: Routes = [
  { path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
  { path: 'map', loadChildren: './map/map.module#MapPageModule' },
  { path: 'search', loadChildren: './search/search.module#SearchPageModule' },
  { path: 'station', loadChildren: './station/station.module#StationPageModule' },
  { path: 'info', loadChildren: './info/info.module#InfoPageModule' },
  { path: 'tarif', loadChildren: './tarif/tarif.module#TarifPageModule' }
];`

and my `tabs.router.module.ts`

`const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children: [
      {
        path: 'home',
        outlet: 'home',
        component: HomePage
      },
      {
        path: 'search',
        outlet: 'search',
        component: SearchPage
      },
      {
        path: 'map',
        outlet: 'map',
        component: MapPage
      },
      {
        path: 'info',
        outlet: 'info',
        component: InfoPage
      },
      {
        path: 'tarif',
        outlet: 'tarif',
        component: TarifPage
      }
    ]
  },
  {
    path: '',
    redirectTo: '/tabs/(home:home)',
    pathMatch: 'full'
  }
];`

The station page must be a child page of Search page ?
Run Code Online (Sandbox Code Playgroud)

Par*_*ami 0

您可以使用文件中的此设置来执行此操作app.module.ts

IonicModule.forRoot(MyApp, {
    tabsHideOnSubPages: false
})
Run Code Online (Sandbox Code Playgroud)