Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
b0a708d4
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看板
提交
b0a708d4
编写于
11月 11, 2024
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
overflow-visible-event: 调整 getBoundingClientRectAsync
上级
af378c99
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
12 deletion
+13
-12
pages/CSS/overflow/overflow-visible-event.uvue
pages/CSS/overflow/overflow-visible-event.uvue
+12
-11
pages/template/navbar-lite/navbar-lite.uvue
pages/template/navbar-lite/navbar-lite.uvue
+1
-1
未找到文件。
pages/CSS/overflow/overflow-visible-event.uvue
浏览文件 @
b0a708d4
...
...
@@ -97,8 +97,8 @@
this.jest_result = true;
}
},
jest_getRect() {
const rect =
uni.getElementById('child')?.getBoundingClientRect
()
async
jest_getRect() {
const rect =
await uni.getElementById('child')!.getBoundingClientRectAsync
()
if (rect != null) {
let ratio = 1
if (uni.getSystemInfoSync().platform == 'android'){
...
...
@@ -120,8 +120,8 @@
this.jest_parent_top = Math.round((parseFloat(value) * ratio))
}
},
jest_getAbsoluteViewRect() {
const rect =
uni.getElementById('absolute-view')?.getBoundingClientRect
()
async
jest_getAbsoluteViewRect() {
const rect =
await uni.getElementById('absolute-view')!.getBoundingClientRectAsync
()
if (rect != null) {
const systemInfo = uni.getSystemInfoSync()
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
...
...
@@ -133,9 +133,9 @@
this.jest_click_y = (rect.top + titleBarHeight) * ratio + 30
}
},
jest_scrollToDeepOverflow() {
async
jest_scrollToDeepOverflow() {
const scrollView = uni.getElementById('scroll-view') as UniScrollViewElement
const rect =
uni.getElementById('deep-overflow')?.getBoundingClientRect
()
const rect =
await uni.getElementById('deep-overflow')!.getBoundingClientRectAsync
()
if (rect != null) {
scrollView.scrollTo(0, rect.top)
setTimeout(() => {
...
...
@@ -145,11 +145,12 @@
ratio = uni.getSystemInfoSync().devicePixelRatio
}
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect()
uni.getElementById('deep-overflow')!.getBoundingClientRectAsync().then((afterRect: DOMRect) => {
if (afterRect != null) {
this.jest_click_x = afterRect.x * ratio + 30
this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30
}
})
}, 200)
}
}
...
...
pages/template/navbar-lite/navbar-lite.uvue
浏览文件 @
b0a708d4
...
...
@@ -120,7 +120,7 @@
async calcInputRemainHeight() {
let windowHeight = uni.getWindowInfo().windowHeight
const rect = await uni.getElementById('input')!.getBoundingClientRectAsync()
this.inputRemainHeight = windowHeight - rect.bottom
?? windowHeight
this.inputRemainHeight = windowHeight - rect.bottom
}
},
onReady() {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录