tingyuxuan2302 / taro3-virtual-list

基于taro3封装的虚拟列表,对列表节点不等高以及白屏等问题支持友好,无计算量,性能优异,支持各大小程序以及h5页面
MIT License
190 stars 26 forks source link

H5 模式下,加载几屏后,页面节点是累计的,不应该只渲染一屏吗 #39

Closed hchlq closed 1 year ago

hchlq commented 1 year ago
<TaroVirtualList
      list={list}
      listId={`zt-virtial-list-${String(count)}`}
      onRender={render}
      // 如果展示完成了 segmentNum 还是没有溢出容器,那么会无法滚动
      segmentNum={segmentNum}
      onComplete={handleComplete}
      onRenderLoad={handleRenderLoad}
      screenNum={1}
      scrollViewProps={{
        style: {
          ...styles,
        },
        lowerThreshold: 50,
      }}
    />
hchlq commented 1 year ago

@tingyuxuan2302 辛苦帮忙看下哈

hchlq commented 1 year ago

加载了 18 屏,每一个 dom 下都有 10 个元素,目前有 18 * 10 个节点

image
tingyuxuan2302 commented 1 year ago

把screenNum改成>=2的数值

hchlq commented 1 year ago

@tingyuxuan2302 还是不行,这和 screenNum 好像没关系的吧

image
tingyuxuan2302 commented 1 year ago

是只有h5这样?

hchlq commented 1 year ago

@tingyuxuan2302 试了一下,其他小程序例如 tt 会有的,不只是 h5

20230803102439_rec_

hchlq commented 1 year ago

这个好修吗?

tingyuxuan2302 commented 1 year ago

你taro什么版本,最好中版本与组件保持一致,不然taro官方升级,会导致一些问题

hchlq commented 1 year ago

3.3.20

hchlq commented 1 year ago

你在你的版本上没有问题吗?

tingyuxuan2302 commented 1 year ago

你可以把我代码拉下来看看,我代码里也有现成的demo,你跑下试试

hchlq commented 1 year ago

抱歉,是我的问题,listId 写错了,感谢回答~