ion-menu is not working
This is my sidemenu.component.html
<ion-split-pane contentId="menu-content" when="xs">
<ion-menu contentId="menu-content" >
<ion-content>
<ion-item *ngIf="tabSelec == 'lead'" lines="none" routerLink="/hometab/lead
routerDirection="root" routerLinkActive="active-link">
<ion-icon src="assets/imgs/leadsSelec.svg"></ion-icon>
<ion-label> Leads </ion-label>
</ion-item>
<ion-item *ngIf="tabSelec != 'lead'" lines="none" routerLink="/hometab/lead
routerDirection="root" routerLinkActive="active-link">
<ion-icon src="assets/imgs/sitesSelec.svg"></ion-icon>
<ion-label>Leads</ion-label>
</ion-item>
<ion-item *ngIf="tabSelec == 'sites'" lines="none" routerLink="/hometab/sites
[queryParams]="{pri: 'leads', sec: true}" routerDirection="root"
routerLinkActive="active-link">
<ion-icon class="img" src="assets/imgs/sitesSelec.svg"></ion-icon>
<ion-label > Sites </ion-label>
</ion-item>
<ion-item *ngIf="tabSelec != 'sites'" lines="none" routerLink="/hometab/sites
[queryParams]="{pri: 'leads', sec: true}" routerDirection="root"
routerLinkActive="active-link">
<ion-icon class="img" src="assets/imgs/sitesSelec.svg"></ion-icon>
<ion-label> Sites </ion-label>
</ion-item>
</ion-content>
</ion-menu>
<ion-router-outlet id="menu-content"></ion-router-outlet>
</ion-split-pane>
This is my hometab-rotuing.module.ts
{
path:'',
redirectTo: '/hometab/lead.module',
pathMatch: 'full'
},
{
path:'',
component: HometabPage,
children :[
{
path: 'lead',
loadChildren: () => import('../lead/lead.module').then(m => m.LeadPageModule)
},
{
path: 'sites',
loadChildren: () => import('../sites/sites.module').then(m => m.SitesPageModule)
},
{
path: 'testing',
loadChildren: () => import('../testing/testing.module').then(m => m.TestingPageModule)
},
]
},
Any idea how does it suppose to work? It should automatically redirect me to the lead page after login
Also I'm not able to click on my ion-item, any help appreciated
1条答案
按热度按时间rjzwgtxy1#
您必须提供带有contentId属性的标记,它表示使用sidemu导航时要显示的容器的id。
示例: