- 发布:2021-10-12 10:27
- 更新:2021-10-15 09:24
- 阅读:1029
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.2.9
手机系统: 全部
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
<template>
<view>
<scroll-view style="height: 300px;" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered"
:refresher-threshold="100" refresher-background="lightgreen" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort">
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
triggered: true,
_freshing: false
}
},
onLoad() {
},
methods: {
onRefresh() {
console.log("=======================")
if (this._freshing) return;
this._freshing = true;
setTimeout(() => {
this.triggered = false;
this._freshing = false;
}, 3000)
},
onRestore() {
this.triggered = 'restore'; // 需要重置
console.log("onRestore");
},
onAbort() {
console.log("onAbort");
}
}
}
</script>
<template>
<view>
<scroll-view style="height: 300px;" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered"
:refresher-threshold="100" refresher-background="lightgreen" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort">
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
<view>demo</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
triggered: true,
_freshing: false
}
},
onLoad() {
},
methods: {
onRefresh() {
console.log("=======================")
if (this._freshing) return;
this._freshing = true;
setTimeout(() => {
this.triggered = false;
this._freshing = false;
}, 3000)
},
onRestore() {
this.triggered = 'restore'; // 需要重置
console.log("onRestore");
},
onAbort() {
console.log("onAbort");
}
}
}
</script>
操作步骤:
同上述代码示例
同上述代码示例
预期结果:
onRefresh() 应执行并能看到输出日志
onRefresh() 应执行并能看到输出日志
实际结果:
onRefresh()未执行
onRefresh()未执行
bug描述:
scroll-view中的@refresherrefresh未触发,ios和Android均已测试。3.2.6版本中测试正常
4 个回复
zuosonglin (作者)
顶一下
zuosonglin (作者)
再顶一下
zuosonglin (作者)
顶顶顶
DCloud_UNI_HT
这个版本确实有些问题 ,尝试使用 3.2.10 alpha 是否正常