Ionic 2 scroll event

后端 未结 3 1046
梦谈多话
梦谈多话 2020-12-19 21:58

I have an ion-scroll component. I\'m trying to execute some code during scrolling. In Ionic 1 this was possible using the on-scroll attribute and passing a function.

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-19 22:34

    I found this solution from here: https://forum.ionicframework.com/t/ionic-2-rc4-addscrolllistener/73145/16?u=kamleshappster

    this.content.ionScroll.subscribe(($event) => {
     this.scrollAmount = $event.scrollTop;
    });
    

提交回复
热议问题