I am making a ionic project and i want to have one left menu and one right menu,and the content on the midle.
My poblem is that i can only place one ionic-menu. I tried to place both, but only one appears.
The problems i get i where i place my , because both menus on the ionic docs have one.
This is my code:
Menu: 1 :
<ion-split-pane contentId="main" >
<!-- the side menu -->
<ion-menu side="start" menu-id="test1">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
</ion-menu>
<!-- the main content -->
<ion-router-outlet id="main"></ion-router-outlet>
</ion-split-pane>
Menu 2:
<ion-split-pane contentId="main" >
<!-- the side menu -->
<ion-menu side="start" menu-id="test1">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
</ion-menu>
<!-- the main content -->
<ion-router-outlet id="main"></ion-router-outlet>
</ion-split-pane>
Main content:
<ion-header>
<ion-toolbar>
<ion-title>Receitas</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-menu-button slot="start">TEste</ion-menu-button>
<ion-menu-button slot="end">TEste</ion-menu-button>
</ion-content>
These are in separated files.
I want this :
But when i run the page, only one menu is displayed, the start one.
2条答案
按热度按时间kmbjn2e31#
You need to add another ion-menu to you app.component.html and ensure you add the “side” attribute:
Now in order to feature menu buttons in each of the pages you need to add another ion-menu-button and use "menu" attribute to indicate which side it controls:
Above I used standard sidemenu ionic app (ionic start, then choose sidemenu app template)
3npbholx2#
你可以用我的密码我想这是正确的答案