UNIAPP scroll-view自定义下拉刷新的坑
代码:
html
<scroll-view class="details" scroll-y="true" refresher-enabled="true" :refresher-threshold="100"
:refresher-triggered="triggered" @refresherrefresh="myPullDownRefresh" @scrolltolower="myReachBottom">
</scroll-view>
script
data() {
return {
triggered: false,
}
},
methods: {
myPullDownRefresh() {
console.log('下拉刷新');
this.triggered = true;
//取到结果后,置为false
//this.triggered = false;
},
}
使用自定义下拉刷新@refresherrefresh,一定要配合:refresher-triggered="triggered"使用,
触发下拉刷新时,置为true,刷新结束时,置为false
不然刷新动画不会结束