Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
2c4b8fd2
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6005
Star
91
Fork
164
代码
文件
提交
分支
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看板
提交
2c4b8fd2
编写于
1月 30, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(list-view): 补充测试例 #388
上级
66a710fb
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
107 addition
and
0 deletion
+107
-0
pages.json
pages.json
+6
-0
pages/component/list-view/ListViewWrapper.uvue
pages/component/list-view/ListViewWrapper.uvue
+5
-0
pages/component/list-view/list-view-children-in-slot.test.js
pages/component/list-view/list-view-children-in-slot.test.js
+50
-0
pages/component/list-view/list-view-children-in-slot.uvue
pages/component/list-view/list-view-children-in-slot.uvue
+41
-0
pages/component/list-view/list-view.uvue
pages/component/list-view/list-view.uvue
+5
-0
未找到文件。
pages.json
浏览文件 @
2c4b8fd2
...
@@ -69,6 +69,12 @@
...
@@ -69,6 +69,12 @@
"navigationBarTitleText"
:
"list-view-multiplex-video"
"navigationBarTitleText"
:
"list-view-multiplex-video"
}
}
},
},
{
"path"
:
"pages/component/list-view/list-view-children-in-slot"
,
"style"
:
{
"navigationBarTitleText"
:
"list-view-children-in-slot"
}
},
{
{
"path"
:
"pages/component/sticky-section/sticky-section"
,
"path"
:
"pages/component/sticky-section/sticky-section"
,
"style"
:
{
"style"
:
{
...
...
pages/component/list-view/ListViewWrapper.uvue
0 → 100644
浏览文件 @
2c4b8fd2
<template>
<list-view>
<slot></slot>
</list-view>
</template>
pages/component/list-view/list-view-children-in-slot.test.js
0 → 100644
浏览文件 @
2c4b8fd2
describe
(
'
list-view-children-in-slot
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
it
(
'
dummyTest
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-children-in-slot
'
)
await
page
.
waitFor
(
'
list-view
'
)
})
it
(
'
basic
'
,
async
()
=>
{
let
listItems
=
await
page
.
$$
(
'
list-item
'
)
expect
(
listItems
.
length
).
toBe
(
3
)
let
texts
=
await
page
.
$$
(
'
.text-in-list-item
'
)
for
(
let
i
=
0
;
i
<
texts
.
length
;
i
++
){
expect
(
await
texts
[
i
].
text
()).
toBe
(
`
${
i
}
`
)
}
const
addBtn
=
await
page
.
$
(
'
#add-btn
'
)
await
addBtn
.
tap
()
listItems
=
await
page
.
$$
(
'
list-item
'
)
expect
(
listItems
.
length
).
toBe
(
4
)
texts
=
await
page
.
$$
(
'
.text-in-list-item
'
)
for
(
let
i
=
0
;
i
<
texts
.
length
;
i
++
){
expect
(
await
texts
[
i
].
text
()).
toBe
(
`
${
i
}
`
)
}
const
emptyBtn
=
await
page
.
$
(
'
#empty-btn
'
)
await
emptyBtn
.
tap
()
listItems
=
await
page
.
$$
(
'
list-item
'
)
expect
(
listItems
.
length
).
toBe
(
0
)
await
addBtn
.
tap
()
listItems
=
await
page
.
$$
(
'
list-item
'
)
expect
(
listItems
.
length
).
toBe
(
1
)
texts
=
await
page
.
$$
(
'
.text-in-list-item
'
)
for
(
let
i
=
0
;
i
<
texts
.
length
;
i
++
){
expect
(
await
texts
[
i
].
text
()).
toBe
(
`
${
i
}
`
)
}
})
})
pages/component/list-view/list-view-children-in-slot.uvue
0 → 100644
浏览文件 @
2c4b8fd2
<template>
<!-- #ifdef APP -->
<scroll-view style="flex:1;padding-bottom: 20px;">
<!-- #endif -->
<view>
<page-head title="getApp"></page-head>
<view class="uni-padding-wrap">
<list-view-wrapper>
<list-item v-for="item in list" :key="item">
<text class="text-in-list-item">{{item}}</text>
</list-item>
</list-view-wrapper>
<button id="add-btn" class="uni-common-mt" @click="addItem">add item</button>
<button id="empty-btn" class="uni-common-mt" @click="emptyList">empty list</button>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
import ListViewWrapper from './ListViewWrapper.uvue'
export default {
components: { ListViewWrapper },
data() {
return {
list: [0, 1, 2]
}
},
methods: {
addItem(){
this.list.push(this.list.length)
},
emptyList(){
this.list = []
}
}
}
</script>
pages/component/list-view/list-view.uvue
浏览文件 @
2c4b8fd2
...
@@ -198,6 +198,11 @@
...
@@ -198,6 +198,11 @@
list-view 复用测试(item中嵌入video)
list-view 复用测试(item中嵌入video)
</button>
</button>
</navigator>
</navigator>
<navigator url="/pages/component/list-view/list-view-children-in-slot" hover-class="none">
<button type="primary" class="button">
list-view 测试插槽中子组件增删
</button>
</navigator>
</view>
</view>
</scroll-view>
</scroll-view>
</template>
</template>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录