angular - Angular Ionic 应用程序中完全两个不同的选项卡具有不同的路由
问题描述
我试图在 Angular Ionic 应用程序上获得两个完全不同的选项卡菜单。我的应用程序底部已经有标签。
第一个菜单选项卡
仪表板 - 搜索 - 收件箱 - 个人资料
我需要创建第二个菜单选项卡:
仪表板 - 游戏 - 聊天 - 联系
我希望在这两种情况下都拥有相同的仪表板。
在我的选项卡路由模块中:
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
{
path: 'tabs',
loadChildren: () => import('../tabs/tabs.module').then( m => m.TabsPageModule)
},
{
path: 'dashboard',
loadChildren: () => import('../dashboard/dashboard.module').then(m => m.DashboardPageModule)
},
{
path: 'search',
loadChildren: () => import('../search/search.module').then(m => m.SearchPageModule)
},
{
path: 'inbox',
loadChildren: () => import('../inbox/inbox.module').then(m => m.InboxPageModule)
},
{
path: 'profile',
loadChildren: () => import('../profile/profile.module').then(m => m.ContactPageModule)
},
{
path: '',
redirectTo: '/tabs/about',
pathMatch: 'full'
}
]
},
{
path: '',
redirectTo: '/tabs/about',
pathMatch: 'full'
}
];
选项卡 html 页面
<ion-tabs>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="about">
<ion-icon name="person-circle-outline"></ion-icon>
<ion-label>Dashboard</ion-label>
</ion-tab-button>
<ion-tab-button tab="tabs">
<ion-icon name="play-outline"></ion-icon>
<ion-label>Search</ion-label>
</ion-tab-button>
<ion-tab-button tab="tabs">
<ion-icon name="albums"></ion-icon>
<ion-label>Index</ion-label>
</ion-tab-button>
<ion-tab-button tab="blog">
<ion-icon name="albums-outline"></ion-icon>
<ion-label>Profile</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
我很难为第二种类型的选项卡定义路由。
Angular 中是否可以有两个完全不同的选项卡?如果是的话,如果您能帮助我进行路由或任何非常感谢的提示,我将不胜感激。
解决方案
推荐阅读
- node.js - 在 Google Cloud Standard App Engine 中直接推送 .env 文件的缺点
- reactjs - Reactjs Redux applymiddleware没有调用?
- c++ - 如何从 C++17 编写的代码中导出 C++03 的 abi
- javascript - 通过过滤在数组中查找匹配数据
- python - 使用 win32com 的 CANoe 多个实例
- android - dataSet.createDataPoint().setTimeInterval() 已被弃用 Fitness History API
- c# - Http Client 无法从传输连接中读取数据:现有连接被远程主机强行关闭
- python - 当 python 脚本转换为 exe 时,来自网络驱动器的图像不会显示
- java - java.lang.OutOfMemoryError:使用 TransferManager 将大文件上传到 Amazon AWS S3 存储桶时的 Java 堆空间
- java - 我可以在 java-11 spring boot 2 项目中使用 java-8 编译的项目/库吗?