miniprogram-recycle-view 导致页面卡死,我使用方式不对吗?
发布于 5 年前 作者 wangping 8015 次浏览 来自 官方Issues
// 声明
let weatherContext: ReturnType<typeof createRecycleContext> | null = null;

// 初始化
weatherContext = createRecycleContext({
            id: 'weatherId',
            dataKey: 'recycleList',
            page: this,
            itemSize: {
                width: transformRpx('480rpx'),
                height: transformRpx('140rpx')
            }
        })

// 添加数据,在这一步直接卡死
weatherContext && weatherContext.append(data.data)
1 回复

我自己来回答吧,卡死的原因是transformRpx 返回的是字符串数字,至于为什么字符串数字会导致页面卡死就不知道为什么了。

回到顶部