Use nav.push with side menu in ionic 2

前端 未结 1 393
我在风中等你
我在风中等你 2020-11-29 12:57

I try to make a little app in ionic2 to learn about it but I have a problem with navigation.

In fact I have well understand the difference between a

相关标签:
1条回答
  • 2020-11-29 13:19

    EDIT:

    What about using persistent="true" in your ion-menu item? Like you can see in Ionic2 docs:

    Persistent Menus Persistent menus display the MenuToggle button in the NavBar on all pages in the navigation stack. To make a menu persistent set persistent to true on the element. Note that this will only affect the MenuToggle button in the NavBar attached to the Menu with persistent set to true, any other MenuToggle buttons will not be affected.

    So your app.html woul be:

    <ion-menu [content]="content" persistent="true">
    
      <ion-toolbar>
        <ion-title>Pages</ion-title>
      </ion-toolbar>
    
      <ion-content>
        <ion-list>
          <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
            {{p.title}}
          </button>
          <button menuClose ion-item (click)="logout()">Logout</button>
        </ion-list>
      </ion-content>
    
    </ion-menu>
    
    <ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
    
    0 讨论(0)
提交回复
热议问题