Skip to content

Commit f2ddbe6

Browse files
author
cunjinli
committed
Fix #32 #29
1 parent 8f35edb commit f2ddbe6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "miniprogram-recycle-view",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "miniprogram custom component",
55
"main": "miniprogram_dist/index.js",
66
"scripts": {

src/utils/recycle-context.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,7 @@ RecycleContext.prototype._recalculateSize = function (list) {
340340
const listLen = list.length
341341
// 把整个页面拆分成200*200的很多个方格, 判断每个数据落在哪个方格上
342342
for (let i = 0; i < listLen; i++) {
343-
if (typeof list[i].__index__ === 'undefined') {
344-
list[i].__index__ = i
345-
}
343+
list[i].__index__ = i
346344
let itemSize = {}
347345
// 获取到每一项的宽和高
348346
if (funcExist) {
@@ -574,4 +572,8 @@ RecycleContext.prototype.getTotalHeight = function () {
574572
this.checkComp()
575573
return this.comp.getTotalHeight()
576574
}
575+
// 返回完整的列表数据
576+
RecycleContext.prototype.getList = function () {
577+
return recycleData[this.id].list
578+
}
577579
module.exports = RecycleContext

0 commit comments

Comments
 (0)