Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
10a5b47c
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
371
Star
3
Fork
8
代码
文件
提交
分支
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看板
提交
10a5b47c
编写于
1年前
作者:
DCloud-WZF
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 补充自定义组件中使用 class 定制另一个自定义组件根节点样式测试
上级
ade94056
无相关合并请求
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
103 addition
and
28 deletion
+103
-28
jest-setup.js
jest-setup.js
+3
-0
jest.config.js
jest.config.js
+8
-9
pages.json
pages.json
+24
-10
pages/examples/set-custom-child-component-root-node-class/child.uvue
...les/set-custom-child-component-root-node-class/child.uvue
+15
-0
pages/examples/set-custom-child-component-root-node-class/set-custom-child-component-root-node-class.test.js
...-class/set-custom-child-component-root-node-class.test.js
+15
-0
pages/examples/set-custom-child-component-root-node-class/set-custom-child-component-root-node-class.uvue
...ode-class/set-custom-child-component-root-node-class.uvue
+25
-0
pages/index.uvue
pages/index.uvue
+13
-9
未找到文件。
jest-setup.js
0 → 100644
浏览文件 @
10a5b47c
const
{
toMatchImageSnapshot
}
=
require
(
'
jest-image-snapshot
'
)
expect
.
extend
({
toMatchImageSnapshot
})
This diff is collapsed.
Click to expand it.
jest.config.js
浏览文件 @
10a5b47c
module
.
exports
=
{
testTimeout
:
10000
,
reporters
:
[
'
default
'
],
watchPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
/dist/
'
,
'
/.git/
'
],
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
rootDir
:
__dirname
,
testMatch
:
[
"
<rootDir>/pages/**/**/*.test.js
"
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
]
testTimeout
:
10000
,
reporters
:
[
'
default
'
],
watchPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
/dist/
'
,
'
/.git/
'
],
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
rootDir
:
__dirname
,
testMatch
:
[
'
<rootDir>/pages/**/**/*.test.js
'
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
],
setupFilesAfterEnv
:
[
'
<rootDir>/jest-setup.js
'
],
}
This diff is collapsed.
Click to expand it.
pages.json
浏览文件 @
10a5b47c
{
"pages"
:
[{
"pages"
:
[
{
"path"
:
"pages/index"
,
"style"
:
{
"navigationBarTitleText"
:
"hello uvue"
...
...
@@ -205,19 +206,22 @@
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
},
{
"path"
:
"pages/state/props/props"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
},
{
"path"
:
"pages/state/computed/computed"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
},
{
"path"
:
"pages/state/watch/watch"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
...
...
@@ -244,6 +248,13 @@
"navigationBarTitleText"
:
"嵌套组件通信"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/examples/set-custom-child-component-root-node-class/set-custom-child-component-root-node-class"
,
"style"
:
{
"navigationBarTitleText"
:
"自定义组件中使用 class 定制另一个自定义组件根节点样式"
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
...
...
@@ -261,12 +272,15 @@
}
},
"uniIdRouter"
:
{},
"condition"
:
{
//模式配置,仅开发期间生效
"condition"
:
{
//模式配置,仅开发期间生效
"current"
:
0
,
//当前激活的模式(list
的索引项)
"list"
:
[{
"name"
:
""
,
//模式名称
"path"
:
""
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}]
"list"
:
[
{
"name"
:
""
,
//模式名称
"path"
:
""
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}
]
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/examples/set-custom-child-component-root-node-class/child.uvue
0 → 100644
浏览文件 @
10a5b47c
<template>
<view>
<button class="btn-child bg-orange">button in child page</button>
</view>
</template>
<style>
.btn-child {
width: 300px;
color: rgb(83, 156, 234);
}
.bg-orange{
background-color: rgb(214, 154, 50);
}
</style>
This diff is collapsed.
Click to expand it.
pages/examples/set-custom-child-component-root-node-class/set-custom-child-component-root-node-class.test.js
0 → 100644
浏览文件 @
10a5b47c
const
PAGE_PATH
=
'
/pages/examples/set-custom-child-component-root-node-class/set-custom-child-component-root-node-class
'
describe
(
'
自定义组件中使用 class 定制另一个自定义组件根节点样式
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
screenshot
'
,
async
()
=>
{
const
image
=
await
program
.
screenshot
()
expect
(
image
).
toMatchImageSnapshot
()
})
})
This diff is collapsed.
Click to expand it.
pages/examples/set-custom-child-component-root-node-class/set-custom-child-component-root-node-class.uvue
0 → 100644
浏览文件 @
10a5b47c
<template>
<view>
<button class="btn-page bg-green">button in parent page</button>
<Child />
</view>
</template>
<script lang='uts'>
import Child from "./child.uvue";
export default {
components: {
Child
}
}
</script>
<style>
.btn-page {
width: 280px;
color: rgb(209, 51, 51);
}
.bg-green{
background-color: rgb(105, 154, 105);
}
</style>
This diff is collapsed.
Click to expand it.
pages/index.uvue
浏览文件 @
10a5b47c
...
...
@@ -16,7 +16,7 @@
</view>
</view>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
...
...
@@ -325,6 +325,10 @@
name: '嵌套组件通信',
url: 'nested-component-communication',
enable: true,
},{
name: '自定义组件中使用 class 定制另一个自定义组件根节点样式',
url: 'set-custom-child-component-root-node-class',
enable: true,
}
] as PageItem[],
},
...
...
@@ -353,14 +357,14 @@
setLifeCycleNum(num : number) {
setLifeCycleNum(num)
},
// 自动化测试
getLifeCycleNum() : number {
return state.lifeCycleNum
},
// 自动化测试
checkLaunchPath() : boolean {
const app = getApp()
return app.checkLaunchPath()
// 自动化测试
getLifeCycleNum() : number {
return state.lifeCycleNum
},
// 自动化测试
checkLaunchPath() : boolean {
const app = getApp()
return app.checkLaunchPath()
},
},
}
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录