Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
9088e1b2
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6015
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看板
提交
9088e1b2
编写于
8月 23, 2024
作者:
辛宝Otto
🥊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 补充动态切换 border 截图测试
上级
a31c4674
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
109 addition
and
51 deletion
+109
-51
.editorconfig
.editorconfig
+1
-1
pages/CSS/border/dynamic-border.test.js
pages/CSS/border/dynamic-border.test.js
+38
-15
pages/CSS/border/dynamic-border.uvue
pages/CSS/border/dynamic-border.uvue
+70
-35
未找到文件。
.editorconfig
浏览文件 @
9088e1b2
...
@@ -2,7 +2,7 @@ root = true
...
@@ -2,7 +2,7 @@ root = true
[*]
[*]
charset = utf-8
charset = utf-8
end_of_line =
lf
end_of_line =
auto
indent_style = space
indent_style = space
indent_size = 2
indent_size = 2
trim_trailing_whitespace = true
trim_trailing_whitespace = true
...
...
pages/CSS/border/dynamic-border.test.js
浏览文件 @
9088e1b2
...
@@ -7,7 +7,9 @@ describe('css-dynamic-border', () => {
...
@@ -7,7 +7,9 @@ describe('css-dynamic-border', () => {
// 左上、右上设置圆角
// 左上、右上设置圆角
it
(
'
check_topleft_topright
'
,
async
()
=>
{
it
(
'
check_topleft_topright
'
,
async
()
=>
{
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
expect
(
image
).
toSaveImageSnapshot
();
})
})
...
@@ -15,7 +17,9 @@ describe('css-dynamic-border', () => {
...
@@ -15,7 +17,9 @@ describe('css-dynamic-border', () => {
it
(
'
check_none
'
,
async
()
=>
{
it
(
'
check_none
'
,
async
()
=>
{
await
page
.
callMethod
(
'
changeIndex
'
,
2
)
await
page
.
callMethod
(
'
changeIndex
'
,
2
)
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
expect
(
image
).
toSaveImageSnapshot
();
})
})
...
@@ -23,7 +27,26 @@ describe('css-dynamic-border', () => {
...
@@ -23,7 +27,26 @@ describe('css-dynamic-border', () => {
it
(
'
check_bottomleft_bottomright
'
,
async
()
=>
{
it
(
'
check_bottomleft_bottomright
'
,
async
()
=>
{
await
page
.
callMethod
(
'
changeIndex
'
,
10
)
await
page
.
callMethod
(
'
changeIndex
'
,
10
)
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
})
it
(
'
动态切换为空值
'
,
async
()
=>
{
await
page
.
callMethod
(
'
setBorderBlank
'
)
await
page
.
waitFor
(
100
)
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
})
it
(
'
动态切换空值为有值
'
,
async
()
=>
{
await
page
.
callMethod
(
'
setBorderBlank
'
)
await
page
.
waitFor
(
100
)
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
expect
(
image
).
toSaveImageSnapshot
();
})
})
...
...
pages/CSS/border/dynamic-border.uvue
浏览文件 @
9088e1b2
<template>
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view style="margin: 15px;border-radius: 10px;background-color: white;">
<view style="margin: 15px;border-radius: 10px;background-color: white;">
<view
<view v-for="index in 10" :key="index"
v-for="index in 10" :key="index"
:class="(index < 9 ? 'bb1' : '') + ' ' + (currentIndex == 0 ? 'btlr10 btrr10' : currentIndex == 9 ? 'bblr10 bbrr10' : '')"
:class="(index < 9 ? 'bb1' : '') + ' ' + (currentIndex == 0 ? 'btlr10 btrr10' : currentIndex == 9 ? 'bblr10 bbrr10' : '')"
style="flex-direction: row;align-items: center;padding: 15px"
style="flex-direction: row;align-items: center;padding: 15px"
:style="index == currentIndex ? 'background-color :#57BE6A;' : ''"
:style="index == currentIndex ? 'background-color :#57BE6A;' : ''" @tap="currentIndex = index">
@tap="currentIndex = index">
<view>
<view>
<text style="font-size: 14px;" :style="index == currentIndex ? 'color: #FFFFFF;' : ''">{{ index }}</text>
<text style="font-size: 14px;" :style="index == currentIndex ? 'color: #FFFFFF;' : ''">{{ index }}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view style="margin: 15px;margin-top: 20px;">
<text>动态切换 border 为空值</text>
<text @click="setBorderBlank" class="common" :style="style">
{{isSelect?'选中':'未选中'}}
</text>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
</template>
<script>
<script>
const defaultStyle = 'border:2px solid black;background :#57BE6A;'
export default {
export default {
data() {
data() {
return {
return {
currentIndex: 1,
currentIndex: 1,
style: '' as string,
}
},
computed: {
isSelect() : boolean {
return this.style == defaultStyle
}
}
},
},
methods: {
methods: {
changeIndex(index: number) {
changeIndex(index
: number) {
this.currentIndex = index
this.currentIndex = index
},
setBorderBlank() {
this.style = this.style == '' ? defaultStyle : ''
}
}
}
}
}
}
</script>
</script>
<style>
<style>
.bb1{
.common {
padding: 15px;
border-radius: 4px;
width: 120px;
text-align: center;
margin-top: 10px;
}
.bb1 {
border-bottom: 1rpx solid #EEEEEE;
border-bottom: 1rpx solid #EEEEEE;
}
}
.btlr10{
.btlr10 {
border-top-left-radius: 10rpx;
border-top-left-radius: 10rpx;
}
}
.btrr10{
.btrr10 {
border-top-right-radius: 10rpx;
border-top-right-radius: 10rpx;
}
}
.bblr10{
.bblr10 {
border-bottom-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
}
}
.bbrr10{
.bbrr10 {
border-bottom-right-radius: 10rpx;
border-bottom-right-radius: 10rpx;
}
}
</style>
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录