页面使用wx:for 循环加载页面列表内容,集合长度1000以上导致页面直接卡死,有什么解决办法?

小程序 文章 2021-03-03 15:21 516 0 全屏看文

AI助手支持GPT4.0

页面使用wx:for 循环加载页面列表内容,集合长度1000以上导致页面直接卡死,有什么解决办法?The page uses wx:for to load the content of the page list in a loop, and the collection length is more than 1000, which causes the page to freeze directly. Is there any solution?

页面使用wx:for 循环加载页面列表内容,集合长度1000以上导致页面直接卡死,有什么解决办法?

页面使用wx:for 循环加载页面列表内容,集合内容长度是1000以上 导致页面直接卡死,当前这个页面所有点击方法都无法点击,有没有什么好的办法呐?

The page uses the Wx: for loop to load the list content of the page. The length of the collection content is more than 1000, which leads to the page directly blocked. At present, all the click methods of this page can't be clicked. Is there any good way?

回答:

黑夜白昼:

改成 20 or 100 吧

黑夜白昼:1000个,用户看得完?比较浪费性能
温水煮泡面:

有现成的官方解决方案,长列表组件

https://developers.weixin.qq.com/miniprogram/dev/extended/component-plusecycle-view.html



-EOF-

AI助手支持GPT4.0