列表是多样式列表,现在上下滑动数据错乱,写法如下:
List({scroller: this.scroller}) {
LazyForEach(this.dataSource, (item?: Object, index?: number) => {
ListItem(){
if (item) {
this.convert?.(this.vm, item, index)
}
}
}, (item?: Object, index?: number) => {
return this.keyGenerator?.(item, index) ?? ""
})
}
后续根据item中的type显示不同的布局。
目前定位下来,是因为lazyforeach没有加载整屏完成 就scroll导致的问题。可以添加一个判断是否需要scroll的scrollfag,通过listitem的appear回调+scroll的fag+计数,判断 整屏幕的所有listitem加载完成,再scroll,并在scroll之前将scrollfaq false。