tabsHideOnSubPages不适用于弹出窗口

时间:2016-12-16 17:41:11

标签: javascript angular typescript ionic-framework ionic2

我希望在浏览popover后保留标签。选项卡不响应tabsHideOnSubPages:false,并且每当我使用弹出窗口导航时总是隐藏。

要重现此问题:

  1. 离子启动项目testingProject tabs -v2
  2. 离子g页面测试
  3. app.module.ts

    @NgModule({
      ...
      ,
      imports: [
        IonicModule.forRoot(MyApp, {
          tabsHideOnSubPages: false
        })
      ],
      ...
    })
    

    home.html的

    <ion-header>
      <ion-navbar>
        <button icon-only (click)="presentPopover($event)">
          <ion-icon name="menu"></ion-icon>
        </button>
        <ion-title>Home</ion-title>
      </ion-navbar>
    </ion-header>
    <ion-content padding>
       ...
    </ion-content>
    

    home.ts

    export class HomePage {
    
      constructor(public navCtrl: NavController, private popoverCtrl: PopoverController) {
    
      }
    
      presentPopover(event) {
        let popover = this.popoverCtrl.create(HeaderPopover);
        popover.present({
          ev: event
        });
      }
    }
    

    标题-popover.ts

    export class HeaderPopover {
        page: any;
        constructor(public app: App, public viewCtrl: ViewController) {
            this.page = TestingPage;
        }
    
        closePopover() {
            return this.viewCtrl.dismiss();
        }
    
        openPage(page) {
            this.closePopover().then(() => {
                this.app.getRootNav().push(page);
            });
        }
    }
    

    标题-popover.html

    <ion-list>
        <button ion-item (click)="openPage(page)">
            <h2>Testing Page</h2>
        </button>
    </ion-list>
    

    离子信息

    Cordova CLI: 6.4.0
    Ionic Framework Version: 2.0.0-rc.4
    Ionic CLI Version: 2.1.17
    Ionic App Lib Version: 2.1.7
    Ionic App Scripts Version: 0.0.47
    ios-deploy version: 1.9.0
    ios-sim version: 5.0.11
    OS: macOS Sierra
    Node Version: v6.9.1
    Xcode version: Xcode 8.2 Build version 8C38
    

0 个答案:

没有答案