【问题标题】:how to use ion-refresher inside a custom component如何在自定义组件中使用离子刷新器
【发布时间】:2019-12-12 16:11:40
【问题描述】:

我需要将离子清新剂放置在组件内。

我有一个外观和行为相同的列表,我的列表组件应该在该组件中有刷新、无限滚动等

我尝试将离子刷新器添加到自定义组件中。

<ion-refresher (ionRefresh)="refreshList($event)">
    <ion-refresher-content></ion-refresher-content>
</ion-refresher>

但我收到此错误:

Parse Error: No provider for Content

【问题讨论】:

    标签: javascript angular ionic-framework ionic3


    【解决方案1】:

    你试过了吗?

    <ion-content>
    <ion-refresher (ionRefresh)="refreshList($event)">
        <ion-refresher-content></ion-refresher-content>
    </ion-refresher>
    </ion-content>
    

    【讨论】:

      【解决方案2】:

      正如heredocs 中提到的,您需要将复习内容放在&lt;ion-content&gt; 标记中。

      <ion-content>
        <ion-refresher (ionRefresh)="refreshList($event)">
          <ion-refresher-content></ion-refresher-content>
        </ion-refresher>
      </ion-content>
      

      【讨论】:

        【解决方案3】:

        当我们在 ion-content 中放置 ion-refresher 时,会产生额外的空间

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-04-23
          • 2018-12-20
          • 1970-01-01
          • 1970-01-01
          • 2022-07-27
          • 1970-01-01
          • 2018-07-21
          • 1970-01-01
          相关资源
          最近更新 更多