提交 b5a3307b 编写于 作者: S shutao

更新scroll-view-refresher示例

上级 ff75f65c
<template> <template>
<view class="container"> <view class="container">
<page-head title="scroll-view 下拉刷新"></page-head> <page-head title="scroll-view 下拉刷新"></page-head>
<scroll-view class="scroll" refresher-enabled = true @refresherrefresh="onRefresherrefresh" :refresher-triggered = "refresherTriggered"> <scroll-view class="scroll" refresher-enabled = true :refresher-triggered = "refresherTriggered"
@refresherrefresh="onRefresherrefresh" @refresherabort="onRefresherabort" @refresherrestore="onRefresherrestore"
@refresherpulling="onRefresherpulling" @scrolltolower="onScrolltolower">
<view v-for="key in scrollData" :key="key"> <view v-for="key in scrollData" :key="key">
<view class="scroll-item"> <view class="scroll-item">
<text class="scroll-item-title">{{key}}</text> <text class="scroll-item-title">{{key}}</text>
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
</view> </view>
</template> </template>
<script> <script>
import RefresherEvent from 'io.dcloud.uniapp.runtime.RefresherEvent';
export default { export default {
data() { data() {
...@@ -36,6 +38,18 @@ import RefresherEvent from 'io.dcloud.uniapp.runtime.RefresherEvent'; ...@@ -36,6 +38,18 @@ import RefresherEvent from 'io.dcloud.uniapp.runtime.RefresherEvent';
this.refresherTriggered = false this.refresherTriggered = false
}, 1500) }, 1500)
},
onRefresherabort(e: RefresherEvent) {
console.log("onRefresherabort------下拉刷新被中止")
},
onRefresherrestore(e: RefresherEvent) {
console.log("onRefresherrestore------下拉刷新被复位")
},
onRefresherpulling(e: RefresherEvent) {
console.log("onRefresherrestore------拉刷新控件被下拉-dy="+e.detail.dy)
},
onScrolltolower(e: ScrollToLowerEvent) {
console.log("onScrolltolower 滚动到底部-----"+e.detail.direction)
} }
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册