Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
479473ee
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看板
提交
479473ee
编写于
6月 30, 2023
作者:
study夏羽
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add rendering
上级
5d624eac
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
165 addition
and
3 deletion
+165
-3
jest.config.js
jest.config.js
+1
-1
pages.json
pages.json
+15
-1
pages/index.uvue
pages/index.uvue
+4
-1
pages/rendering/slots/child.uvue
pages/rendering/slots/child.uvue
+27
-0
pages/rendering/slots/slots.test.js
pages/rendering/slots/slots.test.js
+21
-0
pages/rendering/slots/slots.uvue
pages/rendering/slots/slots.uvue
+34
-0
pages/rendering/template/template.test.js
pages/rendering/template/template.test.js
+16
-0
pages/rendering/template/template.uvue
pages/rendering/template/template.uvue
+47
-0
未找到文件。
jest.config.js
浏览文件 @
479473ee
...
...
@@ -6,6 +6,6 @@ module.exports = {
watchPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
/dist/
'
,
'
/.git/
'
],
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
rootDir
:
__dirname
,
testMatch
:
[
"
<rootDir>/pages/
state
/**/*.test.js
"
],
testMatch
:
[
"
<rootDir>/pages/
**
/**/*.test.js
"
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
]
}
pages.json
浏览文件 @
479473ee
...
...
@@ -174,7 +174,21 @@
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
},
{
"path"
:
"pages/rendering/slots/slots"
,
"style"
:
{
"navigationBarTitleText"
:
"slots"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/rendering/template/template"
,
"style"
:
{
"navigationBarTitleText"
:
"template"
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
"pageOrientation"
:
"portrait"
,
...
...
pages/index.uvue
浏览文件 @
479473ee
...
...
@@ -89,7 +89,10 @@
id: 'rendering',
name: '渲染选项',
open: false,
pages: ['template', 'render', 'slots'].map(createPageItem('rendering'))
pages: [
'template',
// 'render',
'slots'].map(createPageItem('rendering'))
},
{
id: 'component-instance',
...
...
pages/rendering/slots/child.uvue
0 → 100644
浏览文件 @
479473ee
<template>
<view class="container">
<view>
<slot name="header"></slot>
</view>
<view>
<slot></slot>
</view>
<view>
<slot name="footer"></slot>
</view>
</view>
</template>
<script>
export default {
name:"child",
data() {
return {}
},
methods: {}
}
</script>
<style>
</style>
\ No newline at end of file
pages/rendering/slots/slots.test.js
0 → 100644
浏览文件 @
479473ee
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
/pages/rendering/slots/slots
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/rendering/slots/slots
'
)
await
page
.
waitFor
(
500
)
});
it
(
'
slots
'
,
async
()
=>
{
expect
.
assertions
(
3
);
const
childEl
=
await
page
.
$
(
'
child
'
);
const
headerEl
=
await
childEl
.
$
(
'
.header
'
);
expect
(
await
headerEl
.
text
()).
toEqual
(
"
Here might be a page title
"
);
const
mainEl
=
await
childEl
.
$
(
'
.main
'
);
expect
(
await
mainEl
.
text
()).
toEqual
(
"
A paragraph for the main content.
"
);
const
footerEl
=
await
childEl
.
$
(
'
.footer
'
);
expect
(
await
footerEl
.
text
()).
toEqual
(
"
Here's some contact info
"
);
});
});
\ No newline at end of file
pages/rendering/slots/slots.uvue
0 → 100644
浏览文件 @
479473ee
<template>
<view class="content">
<child>
<template v-slot:header>
<view class="header">Here might be a page title</view>
</template>
<template v-slot:default>
<view class="main">A paragraph for the main content.</view>
</template>
<template v-slot:footer>
<view class="footer">Here's some contact info</view>
</template>
</child>
</view>
</template>
<script>
import child from './child.uvue';
export default {
components:{child},
data() {
return {}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
</style>
\ No newline at end of file
pages/rendering/template/template.test.js
0 → 100644
浏览文件 @
479473ee
// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
/pages/rendering/template/template
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/rendering/template/template
'
)
await
page
.
waitFor
(
500
)
})
it
(
'
template
'
,
async
()
=>
{
expect
.
assertions
(
2
);
const
showBtn
=
await
page
.
$
(
'
.show-botton
'
)
await
showBtn
.
tap
()
expect
((
await
page
.
data
()).
isShow
).
toBeFalsy
()
expect
((
await
page
.
$$
(
'
.item
'
)).
length
).
toBe
(
2
)
})
});
\ No newline at end of file
pages/rendering/template/template.uvue
0 → 100644
浏览文件 @
479473ee
<template>
<view class="container">
<template v-if="isShow">
<view>{{title}}</view>
</template>
<view class="show-botton" @click="handleShow">{{isShow?'点击隐藏':'点击显示'}}</view>
<template v-for="(item,index) in list" :key="index">
<view class="item">{{index+1}}.{{item.name}}</view>
</template>
</view>
</template>
<script>
type objType = {
name: string
}
export default {
data() {
return {
title: "hello",
isShow: true,
list: [{
name: 'foo1'
},
{
name: 'foo2'
}
] as objType[]
}
},
methods: {
handleShow() {
this.isShow = !this.isShow
}
}
}
</script>
<style>
.item {
display: flex;
flex-direction: row;
margin: 15px;
border: #eee solid 1px;
}
</style>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录