Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
a20ee298
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a20ee298
编写于
3月 12, 2024
作者:
DCloud_iOS_XHY
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复 下拉刷新示例报错的问题
上级
26963d83
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
14 addition
and
15 deletion
+14
-15
main.uts
main.uts
+3
-1
pages/component/scroll-view/scroll-view-custom-refresher-props.uvue
...onent/scroll-view/scroll-view-custom-refresher-props.uvue
+6
-5
pages/template/custom-refresher/custom-refresher.uvue
pages/template/custom-refresher/custom-refresher.uvue
+5
-9
未找到文件。
main.uts
浏览文件 @
a20ee298
...
@@ -3,7 +3,9 @@ import App from './App.uvue'
...
@@ -3,7 +3,9 @@ import App from './App.uvue'
import { createSSRApp } from 'vue'
import { createSSRApp } from 'vue'
export function createApp() {
export function createApp() {
const app = createSSRApp(App)
const app = createSSRApp(App)
app.config.errorHandler = (err, vm, info) => {
console.log(err, vm, info)
}
app.mixin({
app.mixin({
onReady() {
onReady() {
setTimeout(() => {
setTimeout(() => {
...
...
pages/component/scroll-view/scroll-view-custom-refresher-props.uvue
浏览文件 @
a20ee298
<template>
<template>
<scroll-view style="flex:1;" :refresher-enabled="true" :refresher-triggered="refresherTriggered"
<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 style="height: 25px;"></view>
<view v-for="i in 20" class="content-item">
<view v-for="i in 20" class="content-item">
<text class="text">item-{{i}}</text>
<text class="text">item-{{i}}</text>
...
@@ -38,9 +38,6 @@
...
@@ -38,9 +38,6 @@
methods: {
methods: {
onRefresherpulling(e : RefresherEvent) {
onRefresherpulling(e : RefresherEvent) {
this.pullingDistance = e.detail.dy;
this.pullingDistance = e.detail.dy;
if (this.pullingDistance.toDouble() == 0.0) {
this.resetting = false;
}
},
},
onRefresherrefresh() {
onRefresherrefresh() {
this.refresherTriggered = true
this.refresherTriggered = true
...
@@ -49,6 +46,10 @@
...
@@ -49,6 +46,10 @@
this.resetting = true;
this.resetting = true;
}, 1500)
}, 1500)
},
},
onRefreshrestore() {
this.pullingDistance = 0
this.resetting = false;
}
}
}
}
}
</script>
</script>
...
...
pages/template/custom-refresher/custom-refresher.uvue
浏览文件 @
a20ee298
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
:refresher-enabled="true" :refresher-triggered="refresherTriggered" refresher-default-style="none"
:refresher-enabled="true" :refresher-triggered="refresherTriggered" refresher-default-style="none"
@refresherpulling="onRefresherpulling"
@refresherpulling="onRefresherpulling"
@refresherrefresh="onRefresherrefresh"
@refresherrefresh="onRefresherrefresh"
@refresherrestore="onRefreshrestore"
:refresher-threshold="refresherThreshold"
:refresher-threshold="refresherThreshold"
>
>
<view v-for="i in 20" class="content-item">
<view v-for="i in 20" class="content-item">
...
@@ -43,9 +44,6 @@
...
@@ -43,9 +44,6 @@
onRefresherpulling(e:RefresherEvent){
onRefresherpulling(e:RefresherEvent){
// console.log('onRefresherpulling',e.detail.dy)
// console.log('onRefresherpulling',e.detail.dy)
this.pullingDistance = e.detail.dy
this.pullingDistance = e.detail.dy
if (this.pullingDistance.toDouble() == 0.0) {
this.resetting = false;
}
},
},
onRefresherrefresh(){
onRefresherrefresh(){
this.refresherTriggered = true
this.refresherTriggered = true
...
@@ -53,12 +51,10 @@
...
@@ -53,12 +51,10 @@
this.refresherTriggered = false
this.refresherTriggered = false
},1500)
},1500)
},
},
// onRefresherrestore(e:RefresherEvent){
onRefreshrestore() {
// console.log('onRefresherrestore',e)
this.pullingDistance = 0
// },
this.resetting = false;
// onRefresherabort(e:RefresherEvent){
}
// console.log('onRefresherabort',e)
// },
}
}
}
}
</script>
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录