ionic 3, lazy-loading tabs components

后端 未结 2 1766
广开言路
广开言路 2021-01-04 21:30

I\'m trying to create a ionic 3 tabs app with lazy loading without importing the components .

in my app.component.ts

 rootPage:string = \"Tabs\";
         


        
2条回答
  •  甜味超标
    2021-01-04 21:59

    Check here.

    
    
    

    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.

提交回复
热议问题