Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
b72209a4
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6064
Star
93
Fork
166
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b72209a4
编写于
4月 22, 2024
作者:
DCloud_iOS_XHY
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增 pointer-events 测试例
上级
46e595a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
126 addition
and
0 deletion
+126
-0
pages.json
pages.json
+6
-0
pages/CSS/pointer-events/pointer-events.uvue
pages/CSS/pointer-events/pointer-events.uvue
+110
-0
pages/tabBar/CSS.uvue
pages/tabBar/CSS.uvue
+10
-0
未找到文件。
pages.json
浏览文件 @
b72209a4
...
...
@@ -1014,6 +1014,12 @@
"navigationBarTitleText"
:
"Transition"
}
},
{
"path"
:
"pages/CSS/pointer-events/pointer-events"
,
"style"
:
{
"navigationBarTitleText"
:
"pointer-events"
}
},
{
"path"
:
"pages/CSS/transform/translate"
,
"style"
:
{
...
...
pages/CSS/pointer-events/pointer-events.uvue
0 → 100644
浏览文件 @
b72209a4
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view>
<view class="container1">
<text>控制父视图pointer-events打开时可以点击</text>
<switch checked="true" @change="onChange1" />
</view>
<view class="container" :style="{ 'pointer-events': pointerEvents1 }">
<text class="text">点击修改宽度</text>
<view class="base-style transition-width" id="widthOrHeight" @click="changeWidthOrHeight"></view>
</view>
<view class="container1">
<text>控制遮罩层pointer-events关闭时可以点击</text>
<switch checked="true" @change="onChange2" />
</view>
<view class="container">
<text class="text">点击修改宽度(递增)</text>
<view class="width-progress transition-width" id="widthProgress" @click="changeWidthProgress"></view>
<view class="mask" :style="{ 'pointer-events': pointerEvents2 }"></view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
isTranstionWidthOrHeight: false,
widthOrHeight: null as UniElement | null,
widthProgress: null as UniElement | null,
progressWidth: 200,
pointerEvents1: 'auto',
pointerEvents2: 'auto',
}
},
onReady() {
this.widthOrHeight = uni.getElementById("widthOrHeight")
this.widthProgress = uni.getElementById("widthProgress")
},
methods: {
changeWidthOrHeight() {
this.widthOrHeight?.style?.setProperty("width", this.isTranstionWidthOrHeight
? '200px'
: '300px')
this.isTranstionWidthOrHeight = !this.isTranstionWidthOrHeight
},
changeWidthProgress() {
this.progressWidth += 20
this.widthProgress?.style?.setProperty("width", this.progressWidth + 'px')
},
onChange1(e:UniSwitchChangeEvent) {
this.pointerEvents1 = e.detail.value ? 'auto' : 'none'
},
onChange2(e:UniSwitchChangeEvent) {
this.pointerEvents2 = e.detail.value ? 'auto' : 'none'
}
}
}
</script>
<style>
.container1 {
margin: 7px 0px 7px 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.container {
margin: 7px;
background-color: white;
}
.text {
margin-top: 10px;
margin-bottom: 16px;
}
.base-style {
width: 200px;
height: 200px;
background-color: brown;
}
.width-progress {
width: 200px;
height: 200px;
background-color: brown;
}
.transition-width {
transition-property: width;
transition-duration: 1s;
}
.mask {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 200px;
background-color: rgba(0, 0, 0, 0.5);
}
</style>
pages/tabBar/CSS.uvue
浏览文件 @
b72209a4
...
...
@@ -353,6 +353,16 @@
url: '/pages/CSS/transition/transition',
},
] as Page[],
},
{
id: 'pointer-events',
name: 'pointer-events',
pages: [
{
name: 'pointer-events',
url: '/pages/CSS/pointer-events/pointer-events',
},
] as Page[],
},
{
id: 'variable',
...
...
DCloud_iOS_XHY
@u011616665
mentioned in commit
53304939
·
4月 22, 2024
mentioned in commit
53304939
mentioned in commit 533049393c76a6efad1553a971f64fd9889bf622
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录