提交 a20ee298 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

修复 下拉刷新示例报错的问题

上级 26963d83
......@@ -3,7 +3,9 @@ import App from './App.uvue'
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
app.config.errorHandler = (err, vm, info) => {
console.log(err, vm, info)
}
app.mixin({
onReady() {
setTimeout(() => {
......
<template>
<scroll-view style="flex:1;" :refresher-enabled="true" :refresher-triggered="refresherTriggered"
refresher-default-style="none" @refresherpulling="onRefresherpulling" @refresherrefresh="onRefresherrefresh">
refresher-default-style="none" @refresherpulling="onRefresherpulling" @refresherrefresh="onRefresherrefresh" @refresherrestore="onRefreshrestore">
<view style="height: 25px;"></view>
<view v-for="i in 20" class="content-item">
<text class="text">item-{{i}}</text>
......@@ -38,9 +38,6 @@
methods: {
onRefresherpulling(e : RefresherEvent) {
this.pullingDistance = e.detail.dy;
if (this.pullingDistance.toDouble() == 0.0) {
this.resetting = false;
}
},
onRefresherrefresh() {
this.refresherTriggered = true
......@@ -48,7 +45,11 @@
this.refresherTriggered = false
this.resetting = true;
}, 1500)
},
},
onRefreshrestore() {
this.pullingDistance = 0
this.resetting = false;
}
}
}
</script>
......
......@@ -3,6 +3,7 @@
:refresher-enabled="true" :refresher-triggered="refresherTriggered" refresher-default-style="none"
@refresherpulling="onRefresherpulling"
@refresherrefresh="onRefresherrefresh"
@refresherrestore="onRefreshrestore"
:refresher-threshold="refresherThreshold"
>
<view v-for="i in 20" class="content-item">
......@@ -43,9 +44,6 @@
onRefresherpulling(e:RefresherEvent){
// console.log('onRefresherpulling',e.detail.dy)
this.pullingDistance = e.detail.dy
if (this.pullingDistance.toDouble() == 0.0) {
this.resetting = false;
}
},
onRefresherrefresh(){
this.refresherTriggered = true
......@@ -53,12 +51,10 @@
this.refresherTriggered = false
},1500)
},
// onRefresherrestore(e:RefresherEvent){
// console.log('onRefresherrestore',e)
// },
// onRefresherabort(e:RefresherEvent){
// console.log('onRefresherabort',e)
// },
onRefreshrestore() {
this.pullingDistance = 0
this.resetting = false;
}
}
}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册