wx.createSeclectorQuert()中setData无效?
istextShrink(){
var that=this;
for(var j=0;j<that.data.loadvlog.length;j++){
var textv='#textv'+j;
var textshow='#textshow'+j;
const query = wx.createSelectorQuery() // 创建节点查询器 query
query.select(textv).boundingClientRect()
query.select(textshow).boundingClientRect()
query.exec((res) => {
if(res[0]&&res[0].height){
if(res[0].height>=res[1].height){
that.setData({ //这两个setData没有赋值,读出来是undifined
flag:true
})
}
else{
that.setData({
flag:false
})
}
})
that.setData({
['loadvlog.['+j+'].flag']:that.data.flag
})
}
},