【问题标题】:Side menu is not being shown when push [duplicate]按下 [重复] 时未显示侧菜单
【发布时间】:2018-01-21 15:37:44
【问题描述】:

当我使用push 时,我看不到侧边菜单。但它在setRoot 导航上工作正常。那么我该如何解决这个问题?换句话说,当我使用push 方法时,我需要显示侧边菜单。

dashboard.html

 <ion-col col-9>
  <ion-searchbar (click)="searchPage()" placeholder="Search for Media"></ion-searchbar>
 </ion-col>

dashboard.ts

 searchPage() {
    this.navCtrl.setRoot('SearchPage');//I can see side menu 
    //this.navCtrl.push('SearchPage');//I cannot see side menu 
  }

search.html

<ion-header>
  <ion-navbar color="secondary">
    <button ion-button menuToggle right>
          <ion-icon name="menu"></ion-icon>
        </button>
  </ion-navbar>
</ion-header>

【问题讨论】:

  • 刚看到这个问题,你的答案是解决这个问题的正确方法。
  • 其实,我通过上面的链接得到了你的答案。我已经接受了这个问题的命运是重复的 :) @sebaferreras
  • 希望你这几天很忙,不是吗?我们看不到你的新答案。你在看乔希的新书吗? :) @sebaferreras

标签: angular typescript ionic3


【解决方案1】:

我找到了方法。 即需要使用persistent="true",如下所示。

persistent boolean 如果为 true,则菜单将持续存在于子页面上。

<ion-menu [content]="content" persistent="true">

</ion-menu>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-28
    • 2017-04-18
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 2018-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多