开发工具上调试正常,但是在手机上预览,下拉刷新时异常卡顿.....
代码:
onRefresh() { 查询后setData
<scroll-view
scroll-y style="width: 100%; height: 100%;"
refresher-enabled="{{true}}"
refresher-threshold="{{10}}"
refresher-default-style="white"
refresher-background="#fae500"
refresher-triggered="{{refreshTriggered}}"
bindrefresherpulling="onPulling"
bindrefresherrefresh="onRefresh"
bindrefresherrestore="onRestore"
bindrefresherabort="onAbort"
>
<view class="allView">
<block wx:for="{{items}}" wx:key="XXXXX">
..........
原因找到了: scroll-view的height不能是100%,会导致下滑时没到顶部也刷新,会频繁刷新;需要是个具体的值,比如:500rpx,700px这样就行了https://developers.weixin.qq.com/community/develop/doc/00044eae69463002376c5abb356000
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)