动态设置refresher-triggered的值,当触发下拉刷新时,refresher-triggered = true;当下拉刷新执行完之后refresher-triggered = false。
<scroll-view
:scroll-top="scrollTop"
scroll-y="true"
:refresher-triggered="triggered"
@refresherrefresh="onRefresh"
>
<view id="demo1" class="scroll-view-item uni-bg-red">A</view>
<view id="demo2" class="scroll-view-item uni-bg-green">B</view>
<view id="demo3" class="scroll-view-item uni-bg-blue">C</view>
</scroll-view>
<script>
export default {
data() {
return {
triggered: false
}
},
methods: {
onRefresh(){
this.triggered = true;
setTimeout(() => {
this.triggered = false;
}, 3000)
}
}
}
</script>
详情请阅览scroll-view自定义下拉刷新