wechat-miniprogram / recycle-view

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

在Component中使用是无效的吗? #90

Closed YQjiuhao closed 3 months ago

YQjiuhao commented 3 months ago

我在Component中使用,无法看到显示,似乎不工作 ready() { var ctx = createRecycleContext({ id: 'recycleId', dataKey: 'indexList', page: this, itemSize: () => { // 这个参数也可以直接传下面定义的this.itemSizeFunc函数 debugger return { width: rpx2px(95), height: rpx2px(95), } } }) for (let index = 0; index < 1000; index++) { this.indexList.push(index) } debugger ctx.append(this.indexList) }

YQjiuhao commented 3 months ago

数据必须格式需要为{ "__index__":index, ...Other }