获取元素的宽高
const query = uni.createSelectorQuery().in(this);
query.select('.navigate').boundingClientRect(data => {
console.log(data);
}).exec();
打印结果:
{
"bottom": 88,
"height": 88,
"id": "",
"width": 375,
"left": 0,
"dataset": {
"eventOpts": [
["^clickRightTitle", [
["clickRightBarItem"]
]],
["^clickBack", [
["clickLeftBarItem"]
]]
]
},
"right": 375,
"top": 0
}
网友评论