Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
3d5913ee
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
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看板
提交
3d5913ee
编写于
9月 20, 2023
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitcode.net/dcloud/hello-uni-app-x
into dev
上级
f8be9eff
256b8799
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
136 addition
and
11 deletion
+136
-11
pages/component/general-attribute/general-attribute.uvue
pages/component/general-attribute/general-attribute.uvue
+1
-1
pages/component/image/image.test.js
pages/component/image/image.test.js
+14
-0
pages/component/image/image.uvue
pages/component/image/image.uvue
+5
-3
pages/component/scroll-view/scroll-view-props.test.js
pages/component/scroll-view/scroll-view-props.test.js
+85
-0
pages/component/scroll-view/scroll-view-props.uvue
pages/component/scroll-view/scroll-view-props.uvue
+29
-5
pages/template/drop-card/card/card.uvue
pages/template/drop-card/card/card.uvue
+1
-1
pages/template/pull-zoom-image/pull-zoom-image.uvue
pages/template/pull-zoom-image/pull-zoom-image.uvue
+1
-1
未找到文件。
pages/component/general-attribute/general-attribute.uvue
浏览文件 @
3d5913ee
...
...
@@ -69,7 +69,7 @@ export default {
},
methods: {
validateGeneralAttributes() {
const generalTarget = this.$refs
.get('general-target')
as Element
const generalTarget = this.$refs
['general-target']
as Element
const generalId = generalTarget.getAttribute('id')
if (generalId != this.generalId) {
this.validateGeneralAttrText = '基础属性 id 验证失败'
...
...
pages/component/image/image.test.js
0 → 100644
浏览文件 @
3d5913ee
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
component-native-image
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/image/image
'
);
await
page
.
waitFor
(
600
);
});
it
(
'
check_image_load
'
,
async
()
=>
{
expect
(
await
page
.
data
(
'
loadError
'
)).
toBe
(
false
)
});
});
pages/component/image/image.uvue
浏览文件 @
3d5913ee
...
...
@@ -25,11 +25,13 @@
export default {
data() {
return {
title: 'image'
title: 'image',
loadError: false
}
},
methods: {
error(event : ImageErrorEvent) {
error(event : ImageErrorEvent) {
this.loadError = true
console.log(event.type, event.detail);
},
load(event : ImageLoadEvent) {
...
...
@@ -63,4 +65,4 @@
margin: 40rpx auto;
width: 200rpx;
}
</style>
\ No newline at end of file
</style>
pages/component/scroll-view/scroll-view-props.test.js
0 → 100644
浏览文件 @
3d5913ee
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
component-native-scroll-view
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view-props
'
);
await
page
.
waitFor
(
300
);
});
//检测竖向可滚动区域
it
(
'
check_scroll_height
'
,
async
()
=>
{
await
page
.
setData
({
scrollX
:
false
})
await
page
.
waitFor
(
300
);
const
value
=
await
page
.
callMethod
(
'
checkScrollHeight
'
)
expect
(
value
).
toBe
(
true
)
})
//检测竖向scrolltop属性赋值
it
(
'
check_scroll_top
'
,
async
()
=>
{
await
page
.
setData
({
scrollTop
:
600
})
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewY
'
)
const
scrollTop
=
await
element
.
attribute
(
"
scrollTop
"
)
console
.
log
(
"
check_scroll_top---
"
+
scrollTop
)
expect
(
scrollTop
-
600
).
toBeGreaterThanOrEqual
(
0
)
})
//检测竖向scroll_into_view属性赋值
it
(
'
check_scroll_into_view_top
'
,
async
()
=>
{
await
page
.
setData
({
scrollIntoView
:
"
item3
"
})
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewY
'
)
const
scrollTop
=
await
element
.
attribute
(
"
scrollTop
"
)
console
.
log
(
"
check_scroll_into_view_top--
"
+
scrollTop
)
await
page
.
setData
({
scrollIntoView
:
""
})
expect
(
scrollTop
-
690
).
toBeGreaterThanOrEqual
(
0
)
})
//检测横向可滚动区域
it
(
'
check_scroll_width
'
,
async
()
=>
{
await
page
.
setData
({
scrollX
:
true
})
await
page
.
waitFor
(
300
);
const
value
=
await
page
.
callMethod
(
'
checkScrollWidth
'
)
expect
(
value
).
toBe
(
true
)
})
//检测横向scrollLeft属性赋值
it
(
'
check_scroll_left
'
,
async
()
=>
{
await
page
.
setData
({
scrollLeft
:
600
})
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewX
'
)
const
scrollLeft
=
await
element
.
attribute
(
"
scrollLeft
"
)
console
.
log
(
"
check_scroll_left---
"
+
scrollLeft
)
expect
(
scrollLeft
-
600
).
toBeGreaterThanOrEqual
(
0
)
})
//检测横向scroll_into_view属性赋值
it
(
'
check_scroll_into_view_left
'
,
async
()
=>
{
await
page
.
setData
({
scrollIntoView
:
"
horizontal_item3
"
})
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewX
'
)
const
scrollLeft
=
await
element
.
attribute
(
"
scrollLeft
"
)
console
.
log
(
"
check_scroll_into_view_left--
"
+
scrollLeft
)
await
page
.
setData
({
scrollIntoView
:
""
})
expect
(
scrollLeft
-
1080
).
toBeGreaterThanOrEqual
(
0
)
})
});
pages/component/scroll-view/scroll-view-props.uvue
浏览文件 @
3d5913ee
...
...
@@ -5,11 +5,11 @@
<page-head title="非下拉刷新的scroll-view属性示例"></page-head>
<view class="uni-margin-wrap">
<!-- 暂时分成两个方向不同的滚动视图,原因为:scroll-x或scroll-y属性一经设置不能动态改变。 -->
<scroll-view v-if="scrollX" :scroll-x="true" :scroll-top="scrollTop" :scroll-left="scrollLeft"
<scroll-view v-if="scrollX" :scroll-x="true" :scroll-
y="false" :scroll-
top="scrollTop" :scroll-left="scrollLeft"
:upper-threshold="upperThreshold" :lower-threshold="lowerThreshold" :scroll-into-view="scrollIntoView"
:enable-back-to-top="enableBackToTop" :scroll-with-animation="scrollWithAnimation"
:show-scrollbar="showScrollbar" :rebound="rebound" @scrolltoupper="scrolltoupper"
@scrolltolower="scrolltolower" @scroll="scroll" @scrollend="scrollend">
@scrolltolower="scrolltolower" @scroll="scroll" @scrollend="scrollend"
ref="scrollViewX" id="scrollViewX"
>
<view class="item" :id="'horizontal_'+item.id" v-for="(item,_) in items">
<text class="uni-text">{{item.label}}</text>
</view>
...
...
@@ -18,7 +18,7 @@
:upper-threshold="upperThreshold" :lower-threshold="lowerThreshold" :scroll-into-view="scrollIntoView"
:enable-back-to-top="enableBackToTop" :scroll-with-animation="scrollWithAnimation"
:show-scrollbar="showScrollbar" :rebound="rebound" @scrolltoupper="scrolltoupper"
@scrolltolower="scrolltolower" @scroll="scroll" @scrollend="scrollend">
@scrolltolower="scrolltolower" @scroll="scroll" @scrollend="scrollend"
ref="scrollViewY" id="scrollViewY"
>
<view class="item" :id="item.id" v-for="(item,_) in items">
<text class="uni-text">{{item.label}}</text>
</view>
...
...
@@ -161,7 +161,31 @@
},
scrollend() {
console.log("滚动停止");
}
},
//自动化测试专用
checkScrollHeight(): Boolean {
var element = this.$refs["scrollViewY"]
if(element != null) {
var scrollHeight = (element as Element).scrollHeight
console.log("checkScrollHeight"+scrollHeight)
if(scrollHeight > 1900) {
return true
}
}
return false
},
//自动化测试专用
checkScrollWidth(): Boolean {
var element = this.$refs["scrollViewX"]
if(element != null) {
var scrollWidth = (element as Element).scrollWidth
console.log("checkScrollWidth---"+scrollWidth)
if(scrollWidth > 1900) {
return true
}
}
return false
}
}
}
</script>
...
...
@@ -206,4 +230,4 @@
padding: 30rpx;
justify-content: center;
}
</style>
\ No newline at end of file
</style>
pages/template/drop-card/card/card.uvue
浏览文件 @
3d5913ee
...
...
@@ -82,7 +82,7 @@
setElementStyle(refName:string,propertyName : string, propertyStyle : any) : void {
let element : Element | null = this.$elementMap.get(refName)
if(element == null){
element = this.$refs
.get(refName)
as Element;
element = this.$refs
[refName]
as Element;
this.$elementMap.set(refName,element)
}else{
// console.log('直接拿');
...
...
pages/template/pull-zoom-image/pull-zoom-image.uvue
浏览文件 @
3d5913ee
...
...
@@ -64,7 +64,7 @@
setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void {
let element : Element | null = this.$elementMap.get(refName)
if (element == null) {
element = this.$refs
.get(refName)
as Element;
element = this.$refs
[refName]
as Element;
this.$elementMap.set(refName, element)
}
element.style.setProperty(propertyName, propertyStyle);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录