o***@126.com
o***@126.com
  • 发布:2020-05-05 00:36
  • 更新:2020-09-11 11:32
  • 阅读:3966

uniapp获取元素createSelectorQuery报错问题

分类:uni-app
let dragBox = uni.createSelectorQuery().select('.dragBox')  
dragBox.boundingClientRect(function(pos) {  
}).exec()

各位大佬 这个在app端会报错 是版本问题吗?在安卓机会报错,苹果机ok

报错信息是:

ReferenceError: getApp is not defined at view.umd.min.js:6  
TypeError: Object [object HTMLElement] has no method 'matches' at view.umd.min.js:6

加了in(this)或者添加定时器也不行

2020-05-05 00:36 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

HBuilderX版本多少?是在什么时机获取的?能否提供一个测试工程

  • 嗨哆嚒

    最新版本,小米6X

    2020-09-11 11:41

1***@qq.com

1***@qq.com

https://ext.dcloud.net.cn/plugin?id=451
这个插件
2.6.16.20200424

1***@qq.com

1***@qq.com

小米9pro 2.7.5 20200519 测试机报错

嗨哆嚒

嗨哆嚒 - 嗨哆嚒

小米6x也报错,版本为最新版。代码和报错如下:

                //#ifdef APP-PLUS  
                query = uni.createSelectorQuery().in($this).select('.uni-video-progress-buffered');  
                console.log(query)  
                //#endif

Property or method "toJSON" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

该问题目前已经被锁定, 无法添加新回复