【问题标题】:Ionic 3 Refresher startYIonic 3 Refresher startY
【发布时间】:2017-12-22 12:46:59
【问题描述】:

您能告诉我如何将startYIonic refresher 一起使用吗?我用过如下。但它不起作用?似乎startYgetter 唯一的方法不是吗?我们不能为它设置一个值。这是坏的:(

我的用例:

此时可以从屏幕上的任何位置触发拉动刷新。 Ionic 上是否有一个选项,用于触发拉动的手势仅在从屏幕的最上部完成下拉时才有效?

<ion-refresher (ionRefresh)="getData($event)" [pullMin]="180" startY="80">
    <ion-refresher-content pullingIcon="arrow-dropdown" pullingText="Pull to refresh" refreshingSpinner="crescent" refreshingText="Refreshing...">
    </ion-refresher-content>
  </ion-refresher>

【问题讨论】:

    标签: ionic-framework ionic2 ionic3


    【解决方案1】:

    新功能:

    目前您不能。他们将来会提供此功能。 Set Refresher startY position

    旧:

    这是用户在页面中开始刷新的 Y 位置。可以这样搞定。

    refreshList(refresher) {
      this.myService.getList().then((data) => {
        console.log(refresher.startY);
        refresher.complete();
      });
    }
    

    我认为您不能设置问题中提到的值。

    【讨论】:

    • 只有getter 方法吗?如何根据我的用例设置值?我不能实现那个用例吗?
    • 我认为您可以通过考虑 startY 值来选择是否刷新。但我想不出任何方法可以禁用下拉功能。
    • 嗯..这很糟糕。我把它作为一个功能问了:github.com/ionic-team/ionic/issues/12387
    • 你的意思是这种代码不是吗? if (refresher.startY &gt; 100) { refresher.cancel(); return; }。问题是,他仍然可以从屏幕上的任何位置拉它。我需要禁用该功能。
    猜你喜欢
    • 1970-01-01
    • 2020-06-21
    • 1970-01-01
    • 2020-11-18
    • 2021-04-20
    • 1970-01-01
    • 2021-04-27
    • 2017-08-05
    • 2017-06-01
    相关资源
    最近更新 更多