ionic 3, lazy-loading tabs components

ぐ巨炮叔叔 提交于 2019-11-30 19:09:43

Check here.

<ion-tab [root]="Favorites" tabTitle="fav" tabIcon="star"></ion-tab>
<ion-tab [root]="libaray" tabTitle="Library" tabIcon="book"></ion-tab>

Here libaray and Favorites need to be variables of the component.

In your component try setting string equivalent of the ionic page to the variables in Tabs.ts:

export class Tabs{
 Favorites:any='Favorites';
 libaray:any = 'libaray'; //assuming you tried to give the page class name to `root`.
}

Note: Be sure not to import your lazy loaded pages anywhere other than within the page module.

Ensure at Tabs.html you include [root]="FavoritesRoot" as indicated below

<ion-tabs>
<ion-tab [root]="FavoritesRoot" tabTitle="fav" tabIcon="star"></ion-tab>
<ion-tab [root]="libarayRoot" tabTitle="Library" tabIcon="book"></ion-tab>
</ion-tabs>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!