wechat-miniprogram / recycle-view

recycle-view: a wechat miniprogram custom component
MIT License
635 stars 72 forks source link

开发者工具没有报错,ios和安卓机报height undefined,无法显示页面 #22

Closed chenchao6 closed 5 years ago

chenchao6 commented 5 years ago

ios和安卓渲染页面时, recycle-context.js 报错height undefined offsetTop += sizeArray[sizeArray.length - 2].height

需要改成:

if (sizeArray.length >= 2 ) {
        offsetTop += sizeArray[sizeArray.length - 2].height || 0 // 加上最后一个数据的高度
 } else {
        offsetTop += itemSize.height
 } 

就能正常运行了

cunjinli6 commented 5 years ago

你是用仓库demo跑报错么?如果不是,麻烦提供下https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

cunjinli6 commented 5 years ago

0.1.1 fixed