How does uni-app get the height of an element

how to get the height of the dom element and the scrolling distance.

Nov.12,2021

Baidu:

The

element js gets the height of the dom element and the scrolling distance.

< hr >

Mini Program has api

https://blog.csdn.net/bright2017/article/details/82736078

< hr >

the details are as follows:

const query = wx.createSelectorQuery()
query.select('-sharpthe-id').boundingClientRect()
query.selectViewport().scrollOffset()
query.exec(function(res){
  res[0].top       // -sharpthe-id
  res[1].scrollTop // 

  console.log('',res[0].height);
  console.log('demo',res);
})

but it is completely useless on APP

Menu