一:
getDescBox () {
  uni.createSelectorQuery().in(this).select('.' + class).boundingClientRect(result => {
    if (result) {
      console.log(result)
    } else {
      this.getDescBox()
    }
  }).exec()
}
二:
getDescBox () {
  uni.createSelectorQuery().in(this).select('.' + class).boundingClientRect().exec((res)=>{
    
if (res\[0\]) {
      
this.descHeight \= res\[0\].height
    }else {
      this.$nextTick(()=>{
        this.getDescBox()
       })
    }
  })
}
 
posted on 2020-04-21 16:49  matexia  阅读(8424)  评论(0)    收藏  举报