AbnerMing888 / HarmonyOsRefresh

HarmonyOsRefresh是一个鸿蒙版的刷新组件,超简单使用,支持下拉刷新和上拉加载,支持各种组件,List、Grid、Column、Row……
Apache License 2.0
169 stars 20 forks source link

每次上滑都会触发 onLoadMore,应该是滑到没有数据时才触发,现在是渲染已经加载好的数据也触发。 #191

Open wangbo1185742894 opened 3 weeks ago

AbnerMing888 commented 3 weeks ago

需要看下您的相关代码,初步猜测,可能使用有问题

wangbo1185742894 commented 2 weeks ago
ListView({
  autoShowEmptyLayout:true,
  itemHeaderLayout: () => {
    if (this.itemHeaderLayout) {
      this.itemHeaderLayout()
    }
  },
  isScrollSpring: false,
  lazyDataSource: this.dataSource,
  lazyCachedCount: 6,
  itemFooterLayout: () => {
    this.footerLoadLayout()
  },
  itemLayout: (item, index) => {
    if (this.itemLayout) {
      this.itemLayout(item as ECDFileObject, index)
    }
  }, //条目布局
  controller: this.controller, //控制器,负责关闭下拉和上拉
  emptyLayout: () => this.emptyPage(this.emptyTip,this.emptySubTip),
  enableRefresh: this.loadNewData !== undefined && !this.disableRefresh,
  enableLoadMore: this.loadMoreData !== undefined,
  onRefresh: () => {
    if (this.loadNewData) {
      this.loadNewData(this.dataSource, this.controller);
    }
  },
  onLoadMore: () => {
    if (this.loadMoreData) {
      this.loadMoreData(this.dataSource, this.controller);
    }
  },
  listAttribute: (attr) => {
    attr.height = "100%"
  }
})
  .backgroundColor($r('app.color.backgroundColor_fff'))
  .width('100%')

}

wangbo1185742894 commented 2 weeks ago

@AbnerMing888 帮看一下这个问题哈

zhaopingfu commented 1 week ago

+1