【问题标题】:How to hide ion tabs for inner pages?如何隐藏内页的离子标签?
【发布时间】:2021-04-23 22:22:44
【问题描述】:

我正在使用 ionic 4 和 angular 7。我正在尝试利用 ion-tabs 我想知道如何隐藏内部路由或页面的标签栏。

在谷歌上搜索后,我发现 ionic 3 中有一种方法可以在引导期间在配置中添加属性“tabsHideOnSubPages: true”,但我无法为 ionic 4 找到相同的属性。

const routes: Routes = [
  {
    path: 'tabs',
    component: tabsPage,
    children: [
      {
        path: '',
        redirectTo: '/tabs/tab1',
        pathMatch: 'full'
      },
      {
        path: 'tab1',
        children: [
          {
            path: '',
            component: Tab1Page
          },
          { // want to hide tab bar for this particular route.
            path: ':tabDetailId', 
            component: Tab1DetailPage
          } 
        ]
      },
      {
        path: 'tab2',
        children: [
          {
            path: '',
            component: Tab2Page
          }
        ]
      }
    ]
  }
];

我想隐藏内页的标签栏,例如“domain/tabs/tab1/1”

【问题讨论】:

  • 这是给离子的4
  • @Péttrin Miranda,这是隐藏内页标签栏的最佳做法吗?
  • 可能是最好的解决方案。

标签: angular7 ionic4 angular7-router


【解决方案1】:

尝试替换这个:

{ // 想要隐藏这个特定路由的标签栏。 路径:':tabDetailId', 组件:Tab1DetailPage }

到“app-routing.module.ts”它对我有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-30
    • 2018-06-11
    • 1970-01-01
    • 2015-05-09
    • 1970-01-01
    • 1970-01-01
    • 2015-03-30
    • 1970-01-01
    相关资源
    最近更新 更多