首页 > 解决方案 > 如何改变离子的滑动方向?

问题描述

我试图在两个方向(左和右)上滑动,但无论我做什么滑动,页面总是从右到左弹出。我该怎么做,如果我从左向右滑动页面从左侧出现,如果我向右滑动,页面从右侧出现?

这是我的代码:

page.html:

<ion-content class="home_content" (swipe)="swipe($event)" padding>
</ion-content>

页面.ts

swipe(event) {
    if(event.direction == '2') {
      this.navCtrl.push(Page1);
    }
    if(event.direction == '4') {
      this.navCtrl.push(Page2);
    }
  }
}

该代码有效并推送到两个页面,但它们出现在同一侧(右侧)。

标签: ionic-frameworkionic2swipe

解决方案


推荐阅读