<view class="container">
<view class="box">
<scroll-view
scroll-y
style="width:100%;height:400rpx"
refresher-enabled="{{true}}"
refresher-threshold="{{100}}"
refresher-default-style="white"
refresher-background="lightgreen"
refresher-triggered="{{triggered}}"
bindrefresherpulling="onPulling"
bindrefresherrefresh="onRefresh"
bindrefresherrestore="onRestore"
bindrefresherabort="onAbort">
<view>1</view>
</scroll-view>
</view>
</view>
Page({
data: {
triggered: false
},
onLoad: function () {
},
onPulling(e) {
console.log(e, 'pulling')
},
onRefresh(e) {
console.log(e, 'refresh');
if (this._freshing) return
this._freshing = true
setTimeout(() => {
this.setData({
triggered: false,
})
this._freshing = false
}, 3000)
},
onRestore(e) {
console.log(e, 'restore')
},
onAbort(e) {
console.log(e, 'abort')
}
})