ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.05k stars 13.51k forks source link

bug:最新ionic和vue3 infiniteScroll事件问题 #22249

Closed xlanghejianfeng closed 4 years ago

xlanghejianfeng commented 4 years ago
onMounted(() => {
  const infiniteScroll = document.getElementById("infinite-scroll");
  console.log(infiniteScroll);
  if (infiniteScroll != null) {
    infiniteScroll.addEventListener("Infinite", (event: any) => {
      console.log(event);
      setTimeout(function () {
        console.log("Done");
        event.target.complete();
        // App logic to determine if all data is loaded
        // and disable the infinite scroll
        event.target.disabled = false;
      }, 500);

      //判断是否有更多数据
      if (data.hasmore == false) {
        event.target.complete();
        return;
      }
      const params = {
        pageNo: 1,
        pageSize: 10,
      };
      const result = api.invoiceList(params);
      //判断是否获取到数据
      // if (result.data.length > 0) {
      //   //将获取的数据表与已有数据表连接(concat)
      //   invoiceList.value = invoiceList.value.concat(result.data);
      //   params.pageNo += 1;
      // } else {
      //   hasmore.value = false;
      //   console.log("已加载所有数据!");
      // }
      event.target.complete();
    });
  }

Current behavior:

Expected behavior:

Steps to reproduce:

Related code:

insert short code snippets here

Other information:

Ionic info:

insert the output from ionic info here
BerkeAras commented 4 years ago

Please edit issue: Problem not detectable!

xlanghejianfeng commented 4 years ago

已重新提交问题,谢谢

liamdebeasi commented 4 years ago

Thanks for the issue. I am going to close this as a duplicate of https://github.com/ionic-team/ionic-framework/issues/22250.

xlanghejianfeng commented 4 years ago

Thanks for your reply. May I have a demo of infiniteScroll supported by ionic5 and vue3.0 as detailed as possible? If there is not such a demo, please let me know directly and I will figure out another method.

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Liam DeBeasi <notifications@github.com> 发送时间: 2020年10月5日 21:12 收件人: ionic-team/ionic-framework <ionic-framework@noreply.github.com> 抄送: xlanghejianfeng <717560379@qq.com>, Author <author@noreply.github.com> 主题: 回复:[ionic-team/ionic-framework] bug:最新ionic和vue3 infiniteScroll事件问题 (#22249)

Thanks for the issue. I am going to close this as a duplicate of #22250.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ionitron-bot[bot] commented 4 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.