Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
9088e1b2
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看板
提交
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
...
@@ -4,27 +4,50 @@ describe('css-dynamic-border', () => {
...
@@ -4,27 +4,50 @@ describe('css-dynamic-border', () => {
page
=
await
program
.
reLaunch
(
'
/pages/CSS/border/dynamic-border
'
)
page
=
await
program
.
reLaunch
(
'
/pages/CSS/border/dynamic-border
'
)
await
page
.
waitFor
(
600
);
await
page
.
waitFor
(
600
);
})
})
// 左上、右上设置圆角
// 左上、右上设置圆角
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
();
})
})
// 取消圆角
// 取消圆角
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
();
})
// 左下,右下设置圆角
it
(
'
check_bottomleft_bottomright
'
,
async
()
=>
{
await
page
.
callMethod
(
'
changeIndex
'
,
10
)
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
();
})
})
it
(
'
动态切换空值为有值
'
,
async
()
=>
{
// 左下,右下设置圆角
await
page
.
callMethod
(
'
setBorderBlank
'
)
it
(
'
check_bottomleft_bottomright
'
,
async
()
=>
{
await
page
.
waitFor
(
100
)
await
page
.
callMethod
(
'
changeIndex
'
,
10
)
const
image
=
await
program
.
screenshot
({
await
page
.
waitFor
(
100
)
fullPage
:
true
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
});
expect
(
image
).
toSaveImageSnapshot
();
expect
(
image
).
toSaveImageSnapshot
();
})
})
})
})
pages/CSS/border/dynamic-border.uvue
浏览文件 @
9088e1b2
<template>
<template>
<view style="margin: 15px;border-radius: 10px;background-color: white;">
<!-- #ifdef APP -->
<view
<scroll-view style="flex: 1">
v-for="index in 10" :key="index"
<!-- #endif -->
:class="(index < 9 ? 'bb1' : '') + ' ' + (currentIndex == 0 ? 'btlr10 btrr10' : currentIndex == 9 ? 'bblr10 bbrr10' : '')"
<view style="margin: 15px;border-radius: 10px;background-color: white;">
style="flex-direction: row;align-items: center;padding: 15px"
<view v-for="index in 10" :key="index"
:style="index == currentIndex ? 'background-color :#57BE6A;' : ''"
:class="(index < 9 ? 'bb1' : '') + ' ' + (currentIndex == 0 ? 'btlr10 btrr10' : currentIndex == 9 ? 'bblr10 bbrr10' : '')"
@tap="currentIndex = index">
style="flex-direction: row;align-items: center;padding: 15px"
<view>
:style="index == currentIndex ? 'background-color :#57BE6A;' : ''" @tap="currentIndex = index">
<text style="font-size: 14px;" :style="index == currentIndex ? 'color: #FFFFFF;' : ''">{{ index }}</text>
<view>
</view>
<text style="font-size: 14px;" :style="index == currentIndex ? 'color: #FFFFFF;' : ''">{{ index }}</text>
</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>
export default {
const defaultStyle = 'border:2px solid black;background :#57BE6A;'
data() {
export default {
return {
currentIndex: 1,
data() {
}
return {
},
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 {
border-bottom: 1rpx solid #EEEEEE;
padding: 15px;
}
border-radius: 4px;
.btlr10{
width: 120px;
border-top-left-radius: 10rpx;
text-align: center;
}
margin-top: 10px;
.btrr10{
}
border-top-right-radius: 10rpx;
}
.bb1 {
.bblr10{
border-bottom: 1rpx solid #EEEEEE;
border-bottom-left-radius: 10rpx;
}
}
.bbrr10{
.btlr10 {
border-bottom-right-radius: 10rpx;
border-top-left-radius: 10rpx;
}
}
.btrr10 {
border-top-right-radius: 10rpx;
}
.bblr10 {
border-bottom-left-radius: 10rpx;
}
.bbrr10 {
border-bottom-right-radius: 10rpx;
}
</style>
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录