使用uni.createSelectorQuery()获取不到nvue页面的元素高度呀
我吃柠檬
- 发布:2020-01-07 10:53
- 更新:2022-01-26 16:50
- 阅读:4778
var query = uni.createSelectorQuery().in(this);
query.select('#test1').boundingClientRect();
query.select('#test2').boundingClientRect();
query.exec(data => {
console.log(JSON.stringify(data));
});
2***@qq.com - WDNLDBigRuny
mounted() {
this.$nextTick(()=>{
const query = uni.createSelectorQuery().in(this);
query.select("#ID").boundingClientRect(data => {
console.log(data)
}).exec();
})
},
2***@qq.com
如果我想获取集合列表的高度query.selectAll('.list').boundingClientRect(); nvue获取不到
2020-02-11 17:16
DCloud_uni-ad_HDX
回复 2***@qq.com: nvue 目前暂不支持 select class, 改为 id("#list")
2020-02-14 20:29
dasensen
现在在nvue中使用exec提示'children' of undefined??
2021-01-06 16:46
5***@qq.com
回复 dasensen: nvue用不了这个
2021-02-22 15:06
2***@qq.com
回复 dasensen: 我也遇到这个问题了?请问解决了么?
2021-09-18 16:18
一抱一个胖猪猪
延时100毫秒获取,已经获取到了,很不错。那些说获取不到或者不支持的,肯定是自己的问题。获取退出全屏时的左边进度时间和右边总时间的宽度 at uni_modules/FatFatMeng-VideoPlayer/components/FatFatMeng-VideoPlayer/mixins/createSelectorQuery/createSelectorQuery.js:19
01:03:26.381 [{"height":12,"right":88,"bottom":258.3333435058594,"width":40,"left":48,"top":246.3333282470703,"id":"extFullleft_currtime","dataset":{}},{"height":12,"right":267,"bottom":258.3333435058594,"width":40,"left":227,"top":246.3333282470703,"id":"extFullright_duration","dataset":{}}] at uni_modules/FatFatMeng-VideoPlayer/components/FatFatMeng-VideoPlayer/mixins/createSelectorQuery/createSelectorQuery.js:25
01:03:26.409 [Object] [{"height":12,"right":88,"bottom":258.3333435058594,"width":40,"left":48,"top":246.3333282470703,"id":"ext...} at uni_modules/FatFatMeng-VideoPlayer/components/FatFatMeng-VideoPlayer/mixins/createSelectorQuery/createSelectorQuery.js:26
01:03:26.433 左边和右边时间的节点信息 at uni_modules/FatFatMeng-VideoPlayer/components/FatFatMeng-VideoPlayer/mixins/createSelectorQuery/createSelectorQuery.js:27
2021-12-18 01:04