Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
4c4af673
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6059
Star
93
Fork
166
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4c4af673
编写于
2月 28, 2024
作者:
shutao-dc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
list-view补充下拉刷新测试例
上级
2b8390d8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
90 addition
and
7 deletion
+90
-7
pages.json
pages.json
+12
-6
pages/component/list-view/list-view-refresh.test.js
pages/component/list-view/list-view-refresh.test.js
+24
-0
pages/component/list-view/list-view-refresh.uvue
pages/component/list-view/list-view-refresh.uvue
+49
-0
pages/component/list-view/list-view.uvue
pages/component/list-view/list-view.uvue
+5
-1
未找到文件。
pages.json
浏览文件 @
4c4af673
...
...
@@ -1080,7 +1080,7 @@
{
"path"
:
"pages/template/swiper-vertical-video/swiper-vertical-video"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"transparent"
}
},
...
...
@@ -1096,7 +1096,7 @@
"path"
:
"pages/template/scroll-fold-nav/scroll-fold-nav"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
"navigationBarBackgroundColor"
:
"transparent"
}
},
...
...
@@ -1131,7 +1131,7 @@
{
"path"
:
"pages/template/pull-zoom-image/pull-zoom-image"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"transparent"
}
},
...
...
@@ -1181,7 +1181,7 @@
"path"
:
"pages/webview-screenshot-comparison/webview-screenshot-comparison"
,
"style"
:
{
"navigationBarTitleText"
:
"截图对比测试"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"transparent"
}
},
...
...
@@ -1189,7 +1189,7 @@
"path"
:
"pages/webview-screenshot/webview-screenshot"
,
"style"
:
{
"navigationBarTitleText"
:
"webview 截图测试"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"transparent"
}
},
...
...
@@ -1214,8 +1214,14 @@
"navigationBarTitleText"
:
"支付"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/component/list-view/list-view-refresh"
,
"style"
:
{
"navigationBarTitleText"
:
"list-view-refresh"
,
"enablePullDownRefresh"
:
false
}
}
//
#endif
],
"globalStyle"
:
{
...
...
pages/component/list-view/list-view-refresh.test.js
0 → 100644
浏览文件 @
4c4af673
describe
(
'
component-native-list-view-refresh
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
it
(
'
dummyTest
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
//打开list-view测试页
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-refresh
'
)
await
page
.
waitFor
(
600
)
})
it
(
'
check_list_view_refresh
'
,
async
()
=>
{
await
page
.
waitFor
(
async
()
=>
{
return
await
page
.
data
(
'
refresherTriggered
'
)
===
false
;
});
//等待下拉刷新结束
await
page
.
waitFor
(
500
)
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toMatchImageSnapshot
();
})
})
pages/component/list-view/list-view-refresh.uvue
0 → 100644
浏览文件 @
4c4af673
<template>
<list-view v-if="list_show" id="listview" style="flex: 1;" show-scrollbar=false :refresher-enabled="true"
:refresher-triggered="refresherTriggered" @refresherrefresh="onRefresherrefresh">
<list-item class="item">
<text>向下滑动触发下拉刷新</text>
</list-item>
<list-item v-for="index in item_count" class="item">
<text>item-------{{index}}</text>
</list-item>
</list-view>
</template>
<script>
export default {
data() {
return {
item_count: 20,
list_show: false,
refresherTriggered: true
}
},
onLoad() {
//延迟显示list-view
setTimeout(() => {
this.list_show = true;
}, 500)
},
methods: {
onRefresherrefresh() {
this.refresherTriggered = true;
setTimeout(() => {
this.refresherTriggered = false;
}, 1000)
}
}
}
</script>
<style>
.item {
padding: 15px;
margin: 0 0 5px 0;
background-color: #fff;
border-radius: 5px;
}
.button_item {
width: 200px;
}
</style>
pages/component/list-view/list-view.uvue
浏览文件 @
4c4af673
...
...
@@ -182,7 +182,11 @@
@confirm="confirm_refresher_background_input"></input-data>
<enum-data :items="size_enum" title="通过id位置跳转" @change="item_change_size_enum"></enum-data>
<navigator url="/pages/component/list-view/list-view-refresh" hover-class="none">
<button type="primary" class="button">
list-view 下拉刷新
</button>
</navigator>
<navigator url="/pages/component/list-view/list-view-multiplex" hover-class="none">
<button type="primary" class="button">
list-view 对list-item复用测试
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录