Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
0b951390
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6033
Star
91
Fork
164
代码
文件
提交
分支
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看板
提交
0b951390
编写于
11月 30, 2024
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(getBoundingClientRectAsync): Android 编译失败问题
上级
b16de6dd
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
17 addition
and
17 deletion
+17
-17
pages/CSS/overflow/overflow-visible-event.uvue
pages/CSS/overflow/overflow-visible-event.uvue
+4
-4
pages/component/rich-text/rich-text.uvue
pages/component/rich-text/rich-text.uvue
+1
-1
pages/template/custom-tab-bar/custom-tab-bar.uvue
pages/template/custom-tab-bar/custom-tab-bar.uvue
+1
-1
pages/template/half-screen/half-screen.uvue
pages/template/half-screen/half-screen.uvue
+3
-3
pages/template/long-list/long-list.uvue
pages/template/long-list/long-list.uvue
+2
-2
pages/template/navbar-lite/navbar-lite.uvue
pages/template/navbar-lite/navbar-lite.uvue
+1
-1
pages/template/scroll-sticky/scroll-sticky.uvue
pages/template/scroll-sticky/scroll-sticky.uvue
+2
-2
pages/template/swiper-list/swiper-list.uvue
pages/template/swiper-list/swiper-list.uvue
+2
-2
pages/template/swiper-list2/swiper-list2.uvue
pages/template/swiper-list2/swiper-list2.uvue
+1
-1
未找到文件。
pages/CSS/overflow/overflow-visible-event.uvue
浏览文件 @
0b951390
...
...
@@ -98,7 +98,7 @@
}
},
async jest_getRect() {
const rect = await uni.getElementById('child')!.getBoundingClientRectAsync()
const rect = await uni.getElementById('child')!.getBoundingClientRectAsync()
!
let ratio = 1
if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio
...
...
@@ -119,7 +119,7 @@
}
},
async jest_getAbsoluteViewRect() {
const rect = await uni.getElementById('absolute-view')!.getBoundingClientRectAsync()
const rect = await uni.getElementById('absolute-view')!.getBoundingClientRectAsync()
!
const systemInfo = uni.getSystemInfoSync()
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
let ratio = 1
...
...
@@ -131,7 +131,7 @@
},
async jest_scrollToDeepOverflow() {
const scrollView = uni.getElementById('scroll-view') as UniScrollViewElement
const rect = await uni.getElementById('deep-overflow')!.getBoundingClientRectAsync()
const rect = await uni.getElementById('deep-overflow')!.getBoundingClientRectAsync()
!
scrollView.scrollTo(0, rect.top)
setTimeout(() => {
const systemInfo = uni.getSystemInfoSync()
...
...
@@ -140,7 +140,7 @@
ratio = uni.getSystemInfoSync().devicePixelRatio
}
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
uni.getElementById('deep-overflow')!.getBoundingClientRectAsync().then((afterRect: DOMRect) => {
uni.getElementById('deep-overflow')!.getBoundingClientRectAsync()
!
.then((afterRect: DOMRect) => {
this.jest_click_x = afterRect.x * ratio + 30
this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30
})
...
...
pages/component/rich-text/rich-text.uvue
浏览文件 @
0b951390
...
...
@@ -68,7 +68,7 @@
},
updateRichTextHeight() {
if (this.richTextElement != null) {
this.richTextElement!.getBoundingClientRectAsync().then((elRect: DOMRect) => {
this.richTextElement!.getBoundingClientRectAsync()
!
.then((elRect: DOMRect) => {
this.richTextHeight = elRect.height
console.log('richTextHeight:', this.richTextHeight)
})
...
...
pages/template/custom-tab-bar/custom-tab-bar.uvue
浏览文件 @
0b951390
...
...
@@ -75,7 +75,7 @@
},
onReady() {
// this.setSelectedIndex(0)
(this.$refs["tabview"] as UniElement).getBoundingClientRectAsync().then((res: DOMRect) => {
(this.$refs["tabview"] as UniElement).getBoundingClientRectAsync()
!
.then((res: DOMRect) => {
this.tabViewHeight = res.height
});
},
...
...
pages/template/half-screen/half-screen.uvue
浏览文件 @
0b951390
...
...
@@ -165,16 +165,16 @@
onReady() {
this.halfNode = this.$refs['halfScreen'] as UniElement;//uni.getElementById('halfScreen');
this.scrollNode = this.$refs['halfScroll'] as UniElement;//uni.getElementById('halfScroll');
this.halfNode!.getBoundingClientRectAsync().then((rect: DOMRect) => {
this.halfNode!.getBoundingClientRectAsync()
!
.then((rect: DOMRect) => {
this.halfHeight = rect.height
});
(this.$refs['page'] as UniElement).getBoundingClientRectAsync().then((rect: DOMRect) => {
(this.$refs['page'] as UniElement).getBoundingClientRectAsync()
!
.then((rect: DOMRect) => {
this.totalHeight = rect.height
this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
});
},
onResize() {
this.halfNode?.getBoundingClientRectAsync().then((rect: DOMRect) => {
this.halfNode?.getBoundingClientRectAsync()
!
.then((rect: DOMRect) => {
this.halfHeight = rect.height
});
this.totalHeight = uni.getWindowInfo().windowHeight;
...
...
pages/template/long-list/long-list.uvue
浏览文件 @
0b951390
...
...
@@ -93,7 +93,7 @@
this.headerHeight = (this.$refs['header'] as UniElement).offsetHeight
this.tabScrollView = this.$refs['tabScroll'] as UniElement
this.indicatorNode = this.$refs['indicator'] as UniElement
(this.$refs["swiper"] as UniElement).getBoundingClientRectAsync().then((res : DOMRect) : Promise<void> => {
(this.$refs["swiper"] as UniElement).getBoundingClientRectAsync()
!
.then((res : DOMRect) : Promise<void> => {
this.swiperWidth = res.width
return this.cacheTabItemsSize()
}).then(() => {
...
...
@@ -179,7 +179,7 @@
const tabs = this.$refs["swipertab"] as UniElement[]
for (let i = 0; i < tabs.length; i++) {
const element = tabs[i];
const rect = await element.getBoundingClientRectAsync()
const rect = await element.getBoundingClientRectAsync()
!
this.swiperTabsRect.push({
x: rect.left,
w: rect.width
...
...
pages/template/navbar-lite/navbar-lite.uvue
浏览文件 @
0b951390
...
...
@@ -121,7 +121,7 @@
},
async calcInputRemainHeight() {
let windowHeight = uni.getWindowInfo().windowHeight
const rect = await uni.getElementById('input')!.getBoundingClientRectAsync()
const rect = await uni.getElementById('input')!.getBoundingClientRectAsync()
!
this.inputRemainHeight = windowHeight - rect.bottom
}
},
...
...
pages/template/scroll-sticky/scroll-sticky.uvue
浏览文件 @
0b951390
...
...
@@ -68,8 +68,8 @@
// let rect = this.stickyNode?.getBoundingClientRect();
// this.stickyTop = rect?.top;
//this.stickyTop = this.stickyNode?.getBoundingClientRect()?.top;
const stickyRect = await (this.$refs['sticky'] as UniElement).getBoundingClientRectAsync();
const scrollRect = await (this.$refs['scroll'] as UniElement).getBoundingClientRectAsync();
const stickyRect = await (this.$refs['sticky'] as UniElement).getBoundingClientRectAsync()
!
;
const scrollRect = await (this.$refs['scroll'] as UniElement).getBoundingClientRectAsync()
!
;
this.stickyTop = stickyRect.top - scrollRect.top;
console.log(stickyRect, scrollRect);
}
...
...
pages/template/swiper-list/swiper-list.uvue
浏览文件 @
0b951390
...
...
@@ -66,7 +66,7 @@
onReady() {
this.tabScrollView = this.$refs['tabScroll'] as UniElement;
this.indicatorNode = this.$refs['indicator'] as UniElement;
(this.$refs["swiper"] as UniElement).getBoundingClientRectAsync().then((res : DOMRect) : Promise<void> => {
(this.$refs["swiper"] as UniElement).getBoundingClientRectAsync()
!
.then((res : DOMRect) : Promise<void> => {
this.swiperWidth = res.width
return this.cacheTabItemsSize()
}).then(() => {
...
...
@@ -128,7 +128,7 @@
const tabs = this.$refs["swipertab"] as UniElement[]
for (let i = 0; i < tabs.length; i++) {
const element = tabs[i];
const rect = await element.getBoundingClientRectAsync()
const rect = await element.getBoundingClientRectAsync()
!
this.swiperTabsRect.push({
x: rect.left,
w: rect.width
...
...
pages/template/swiper-list2/swiper-list2.uvue
浏览文件 @
0b951390
...
...
@@ -54,7 +54,7 @@
},
onReady() {
this.tabScrollView = this.$refs['tabScroll'] as UniElement;
(this.$refs["swiper"] as UniElement).getBoundingClientRectAsync().then((res : DOMRect) => {
(this.$refs["swiper"] as UniElement).getBoundingClientRectAsync()
!
.then((res : DOMRect) => {
this.swiperWidth = res.width
this.updateTabIndicator(this.swiperIndex, this.swiperIndex, 1)
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录