Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
0badb02b
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
356
Star
3
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uvue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
0badb02b
编写于
7月 03, 2023
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add test files(v-if v-slot v-once)
上级
2f9738eb
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
43 addition
and
19 deletion
+43
-19
pages/directive/v-if/v-if.test.js
pages/directive/v-if/v-if.test.js
+16
-5
pages/directive/v-if/v-if.uvue
pages/directive/v-if/v-if.uvue
+1
-1
pages/directive/v-once/v-once.test.js
pages/directive/v-once/v-once.test.js
+6
-1
pages/directive/v-once/v-once.uvue
pages/directive/v-once/v-once.uvue
+9
-2
pages/directive/v-slot/counter.uvue
pages/directive/v-slot/counter.uvue
+2
-1
pages/directive/v-slot/v-slot.test.js
pages/directive/v-slot/v-slot.test.js
+3
-1
pages/directive/v-slot/v-slot.uvue
pages/directive/v-slot/v-slot.uvue
+5
-7
pages/index.uvue
pages/index.uvue
+1
-1
未找到文件。
pages/directive/v-if/v-if.test.js
浏览文件 @
0badb02b
...
...
@@ -6,9 +6,20 @@ describe('v-if', () => {
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
500
)
})
it
(
'
list-items-3
'
,
async
()
=>
{
const
length
=
3
;
const
elements
=
await
page
.
$$
(
'
.list-item
'
)
expect
(
elements
.
length
).
toBe
(
length
)
it
(
'
show-hide-switch
'
,
async
()
=>
{
const
btn_view
=
await
page
.
$
(
'
.view-click
'
)
const
elements1
=
await
page
.
$$
(
'
.hello
'
)
expect
(
elements1
.
length
).
toBe
(
1
)
await
btn_view
.
tap
()
await
page
.
waitFor
(
50
)
const
elements2
=
await
page
.
$$
(
'
.hello
'
)
expect
(
elements2
.
length
).
toBe
(
0
)
await
btn_view
.
tap
()
await
page
.
waitFor
(
50
)
const
elements3
=
await
page
.
$$
(
'
.hello
'
)
expect
(
elements3
.
length
).
toBe
(
1
)
})
})
})
\ No newline at end of file
pages/directive/v-if/v-if.uvue
浏览文件 @
0badb02b
<template>
<view class="page">
<view class="split-title">v-if</view>
<
button @click="onShowOrHide">show/hide</button
>
<
view class="view-click" @click="onShowOrHide">show/hide</view
>
<view class="hello" v-if="show">hello</view>
</view>
</template>
...
...
pages/directive/v-once/v-once.test.js
浏览文件 @
0badb02b
...
...
@@ -6,6 +6,11 @@ describe('v-once', () => {
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
500
)
})
it
(
'
list-items-3
'
,
async
()
=>
{
it
(
'
change-message
'
,
async
()
=>
{
const
btn_change
=
await
page
.
$
(
'
.view-click
'
)
const
messageText
=
await
page
.
$
(
'
.v-once-message
'
)
await
btn_change
.
tap
()
expect
(
await
messageText
.
text
()).
toBe
(
'
message
'
)
})
})
pages/directive/v-once/v-once.uvue
浏览文件 @
0badb02b
<template>
<view class="page">
<view class="split-title">v-once</view>
<view class="v-once" v-once>This will never change: {{msg}}</view>
<view>
<text class="v-once">This will never change:</text>
<text class="v-once-message" v-once>{{message}}</text>
</view>
<view class="view-click" @click="changeMessage">Change message</view>
</view>
</template>
...
...
@@ -9,10 +13,13 @@
export default {
data() {
return {
m
sg: '
'
m
essage: 'message
'
}
},
methods: {
changeMessage() {
this.message = Date.now().toString()
}
}
}
</script>
...
...
pages/directive/v-slot/counter.uvue
浏览文件 @
0badb02b
<template>
<view>
<slot :loading="loading" :error="message" />
<slot />
<!-- <slot :loading="loading" :error="message" /> -->
</view>
</template>
...
...
pages/directive/v-slot/v-slot.test.js
浏览文件 @
0badb02b
...
...
@@ -6,6 +6,8 @@ describe('v-slot', () => {
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
500
)
})
it
(
'
list-items-3
'
,
async
()
=>
{
it
(
'
default
'
,
async
()
=>
{
const
defaultText
=
await
page
.
$
(
'
.default
'
)
expect
(
await
defaultText
.
text
()).
toBe
(
'
loading
'
)
})
})
pages/directive/v-slot/v-slot.uvue
浏览文件 @
0badb02b
<template>
<view class="page">
<view class="split-title">v-slot</view>
<!-- <counter v-slot:default="options">
{{options['loading']}}
</counter> -->
<counter class="default" v-slot:default>loading</counter>
</view>
</template>
<script lang="ts">
//
import counter from "./counter.uvue"
import counter from "./counter.uvue"
export default {
//
components: {
//
counter
//
},
components: {
counter
},
data() {
return {
}
...
...
pages/index.uvue
浏览文件 @
0badb02b
...
...
@@ -118,7 +118,7 @@
{
name: 'v-once',
url: 'v-once',
enable:
tru
e
enable:
fals
e
},
{
name: 'v-memo',
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录