提交 488f7f18 编写于 作者: 雪洛's avatar 雪洛

fix: 修复自定义长列表编译到安卓报错的Bug

上级 42270934
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
[点击下载&安装]() [点击下载&安装]()
::: :::
uni-recycle-view 组件用于在展示超长列表时优化内存占用以及性能。不同于uni-app list-view组件,uni-recycle-view组件不会对所有数据循环创建VNode。适用于仅使用一个for循环创建所有列表项的场景。 uni-recycle-view 组件用于在展示超长列表时优化内存占用以及初次加载时的速度。不同于uni-app list-view组件,uni-recycle-view组件不会对所有数据循环创建VNode。适用于仅使用一个for循环创建所有列表项的场景。
### 基本用法 ### 基本用法
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
}, },
flush() { flush() {
const queueLength = this.rearrangeQueue.length const queueLength = this.rearrangeQueue.length
if (queueLength === 0) { if (queueLength == 0) {
return return
} }
const lastScrollTop = this.rearrangeQueue[queueLength - 1] const lastScrollTop = this.rearrangeQueue[queueLength - 1]
...@@ -109,10 +109,12 @@ ...@@ -109,10 +109,12 @@
this.rearrangeQueue = [] as number[] this.rearrangeQueue = [] as number[]
}, },
rearrange(scrollTop : number) { rearrange(scrollTop : number) {
const offsetStart = this.offsetThreshold[0] = Math.max(scrollTop - this.scrollElementHeight * 5, 0) this.offsetThreshold[0] = Math.max(scrollTop - this.scrollElementHeight * 5, 0)
this.offsetThreshold[1] = Math.max(scrollTop - this.scrollElementHeight * 3, 0) this.offsetThreshold[1] = Math.max(scrollTop - this.scrollElementHeight * 3, 0)
this.offsetThreshold[2] = Math.min(scrollTop + this.scrollElementHeight * 4, this.placeholderHeight) this.offsetThreshold[2] = Math.min(scrollTop + this.scrollElementHeight * 4, this.placeholderHeight)
const offsetEnd =this.offsetThreshold[3] = Math.min(scrollTop + this.scrollElementHeight * 6, this.placeholderHeight) this.offsetThreshold[3] = Math.min(scrollTop + this.scrollElementHeight * 6, this.placeholderHeight)
const offsetStart = this.offsetThreshold[0]
const offsetEnd =this.offsetThreshold[3]
const items = [] as any[] const items = [] as any[]
const defaultItemSize = this.defaultItemSize const defaultItemSize = this.defaultItemSize
const cachedSize = this.cachedSize const cachedSize = this.cachedSize
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册