提交 fd7cd0bc 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

修改 touch-event.uvue 示例 添加条件编译避免在Android 平台报错

(cherry picked from commit 4c382abf)
上级 6d8ab7b2
...@@ -39,10 +39,11 @@ ...@@ -39,10 +39,11 @@
}, },
onReady() { onReady() {
this.icon = uni.getElementById("icon") this.icon = uni.getElementById("icon")
this.iconRect = this.icon.getBoundingClientRect() // #ifdef APP-IOS
this.iconRect = this.icon?.getBoundingClientRect()
// 加上导航栏及状态栏高度 // 加上导航栏及状态栏高度
this.iconRect.y += uni.getSystemInfoSync().safeArea.top + 44 this.iconRect.y += uni.getSystemInfoSync().safeArea.top + 44
// #endif
}, },
methods: { methods: {
onViewTouchStart(e : TouchEvent) { onViewTouchStart(e : TouchEvent) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册