Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
824c1828
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看板
提交
824c1828
编写于
8月 17, 2023
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(component): general event
上级
bb4d8a13
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
183 addition
and
5 deletion
+183
-5
pages.json
pages.json
+12
-3
pages/component/general-event/general-event.uvue
pages/component/general-event/general-event.uvue
+169
-0
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+2
-2
未找到文件。
pages.json
浏览文件 @
824c1828
...
...
@@ -164,6 +164,12 @@
"navigationBarTitleText"
:
"redirectPage"
}
},
{
"path"
:
"pages/component/general-event/general-event"
,
"style"
:
{
"navigationBarTitleText"
:
"general-event"
}
},
{
"path"
:
"pages/tabBar/API"
,
"style"
:
{
...
...
@@ -729,7 +735,8 @@
"navigationBarTitleText"
:
"日历"
,
"enablePullDownRefresh"
:
false
}
},
{
},
{
"path"
:
"pages/template/custom-refresher/custom-refresher"
,
"style"
:
{
"navigationBarTitleText"
:
"自定义下拉刷新"
,
...
...
@@ -742,13 +749,15 @@
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
},
{
"path"
:
"pages/template/half-screen/half-screen"
,
"style"
:
{
"navigationBarTitleText"
:
"半屏弹窗"
,
"enablePullDownRefresh"
:
false
}
},
{
},
{
"path"
:
"pages/template/long-list/long-list"
,
"style"
:
{
"navigationBarTitleText"
:
"复杂长列表"
,
...
...
pages/component/general-event/general-event.uvue
0 → 100644
浏览文件 @
824c1828
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt container">
<view
class="target"
@click="onClick"
@touchstart="onTouchStart"
@touchmove="onTouchMove"
@touchend="onTouchEnd"
></view>
<view v-if="clickEvent !== null">
<text class="title1">click Event: </text>
<text>x: {{ clickEvent!.x }}, y: {{ clickEvent!.y }}</text>
</view>
<view v-if="touchStartEvent !== null">
<text class="title1">touchStart Event: </text>
<text class="title2">touches: </text>
<template
v-for="(touch, index) in touchStartEvent!.touches"
:key="index"
>
<text class="title3">touch[{{ index }}]:</text>
<text>pageX: {{ touch.pageX }}, pageY: {{ touch.pageY }}</text>
<text
>clientX: {{ touch.clientX }}, clientY: {{ touch.clientY }}</text
>
<text
>screenX: {{ touch.screenX }}, screenY: {{ touch.screenY }}</text
>
</template>
<text class="title2 uni-common-mt">changedTouches: </text>
<template
v-for="(touch, index) in touchStartEvent!.changedTouches"
:key="index"
>
<text class="title3">touch[{{ index }}]:</text>
<text>pageX: {{ touch.pageX }}, pageY: {{ touch.pageY }}</text>
<text
>clientX: {{ touch.clientX }}, clientY: {{ touch.clientY }}</text
>
<text
>screenX: {{ touch.screenX }}, screenY: {{ touch.screenY }}</text
>
</template>
</view>
<view v-if="touchMoveEvent !== null">
<text class="title1">touchMove Event: </text>
<text class="title2">touches: </text>
<template
v-for="(touch, index) in touchMoveEvent!.touches"
:key="index"
>
<text class="title3">touch[{{ index }}]:</text>
<text>pageX: {{ touch.pageX }}, pageY: {{ touch.pageY }}</text>
<text
>clientX: {{ touch.clientX }}, clientY: {{ touch.clientY }}</text
>
<text
>screenX: {{ touch.screenX }}, screenY: {{ touch.screenY }}</text
>
</template>
<text class="title2 uni-common-mt">changedTouches: </text>
<template
v-for="(touch, index) in touchMoveEvent!.changedTouches"
:key="index"
>
<text class="title3">touch[{{ index }}]:</text>
<text>pageX: {{ touch.pageX }}, pageY: {{ touch.pageY }}</text>
<text
>clientX: {{ touch.clientX }}, clientY: {{ touch.clientY }}</text
>
<text
>screenX: {{ touch.screenX }}, screenY: {{ touch.screenY }}</text
>
</template>
</view>
<view v-if="touchEndEvent !== null">
<text class="title1">touchEnd Event: </text>
<text class="title2">touches: </text>
<template
v-if="touchEndEvent!.touches.length > 0"
v-for="(touch, index) in touchEndEvent!.touches"
:key="index"
>
<text class="title3">touch[{{ index }}]:</text>
<text>pageX: {{ touch.pageX }}, pageY: {{ touch.pageY }}</text>
<text
>clientX: {{ touch.clientX }}, clientY: {{ touch.clientY }}</text
>
<text
>screenX: {{ touch.screenX }}, screenY: {{ touch.screenY }}</text
>
</template>
<text class="title2 uni-common-mt">changedTouches: </text>
<template
v-for="(touch, index) in touchEndEvent!.changedTouches"
:key="index"
>
<text class="title3">touch[{{ index }}]:</text>
<text>pageX: {{ touch.pageX }}, pageY: {{ touch.pageY }}</text>
<text
>clientX: {{ touch.clientX }}, clientY: {{ touch.clientY }}</text
>
<text
>screenX: {{ touch.screenX }}, screenY: {{ touch.screenY }}</text
>
</template>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
export default {
data() {
return {
title: 'general-event',
clickEvent: null as MouseEvent | null,
touchStartEvent: null as TouchEvent | null,
touchMoveEvent: null as TouchEvent | null,
touchEndEvent: null as TouchEvent | null,
}
},
methods: {
onClick(e: MouseEvent){
this.clickEvent = e
},
onTouchStart(e: TouchEvent){
this.touchStartEvent = e
},
onTouchMove(e: TouchEvent){
this.touchMoveEvent = e
},
onTouchEnd(e: TouchEvent){
this.touchEndEvent = e
}
},
}
</script>
<style>
.container {
padding-bottom: 1000px;
}
.target {
margin: 20px 0 0 50px;
width: 200px;
height: 100px;
background-color: aqua;
}
.title1 {
margin-top: 15px;
font-size: 20px;
}
.title2 {
margin-top: 10px;
font-size: 18px;
}
.title3 {
margin-top: 5px;
font-size: 16px;
}
</style>
pages/tabBar/component.uvue
浏览文件 @
824c1828
...
...
@@ -272,8 +272,8 @@ export default {
},
{
name: '通用事件',
url: 'general-event',
enable:
fals
e,
url: '
/pages/component/general-event/
general-event',
enable:
tru
e,
},
] as Page[],
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录