使用ionic5和angular8。
有两个页面。
Tabs页面:页面中只有TabBar。已有tab1、tab2、tab3三个tab。
Videos页面:新建了一个videos页面,准备把它放进TabBar。
1、tabs.page.html中
增加tab。
<ion-tabs> <ion-tab-bar slot="bottom"> ... <ion-tab-button tab="videos"> <ion-icon name="videocam"></ion-icon> <ion-label>视频</ion-label> </ion-tab-button> ... </ion-tab-bar></ion-tabs>
重点:tab=“videos”。
2、app-routing-modules-ts中
删掉或者注释掉videos页面的路由。
const routes: Routes = [ ... /*{ path: 'videos', loadChildren: () => import('./videos/videos.module').then( m => m.VideosPageModule) },*/ ... ];
3、tabs-routing-modules-ts中
增加videos页面页面的子路由。
const routes: Routes = [ { path: 'tabs', component: TabsPage, children: [ ......... { path: 'videos', children: [ { path: '', loadChildren: () => import('../videos/videos.module').then(m => m.VideosPageModule) } ] }, ......... ] }, ......... ]; 相关文章
开发
· 2 分钟阅读
Cloudflare:如何降低CPU使用时长?
在 Cloudflare 上部署的网站,CPU 时长费用占了账单的大头。通过屏蔽恶意流量、开启静态化和缓存、优化程序这三件事,把 CPU 使用时长降了下来。
开发
· 1 分钟阅读
Codex+Hyperframes:如何用一句话做一个产品介绍视频
用Codex+Hyperframes插件,只需一句话就能生成产品介绍视频,告别繁琐的视频制作流程。
开发
· 1 分钟阅读
Codex+Game studio:做游戏的好工具
推荐使用Codex+Game Studio插件制作浏览器小游戏,涵盖2D和3D游戏开发体验,以及基于Phaser引擎的实践分享。