异步渲染了,加了个定时器,不合理但好用
onReady(){
let that=this
setTimeout(function(){
//获取左上方的高度
wx.createSelectorQuery().in(that).selectAll('#textHeight').boundingClientRect((react)=> {
if(react[0]!==null){
that.setData({
textOpen:react[0].height > 100 ? true : false
})
}
}).exec()
},500)
},