How does WeChat Mini Programs measure the height of an view from the top title bar

how does WeChat Mini Programs measure the height of a view from the top title bar


the answer is here: click here


https://developers.weixin.qq.


if you use node queries frequently, you can encapsulate them. Value is the element selector you want to choose, and _ this is the this passed from the pages page

.
export let domInter = (value, _this) => {
  return new Promise((resolve, reject) => {
    var query = wx.createSelectorQuery().in(_this)
    query.select(value).boundingClientRect(function (res) {
      resolve(res)
    }).exec()
  })
}

doInter('.dom',this).then((res) => {
    console.log(res)
})
Menu