fix: 修复代码报错

pull/6/head
TianYu 2023-05-31 11:47:23 +08:00
parent 035dd77dd4
commit 039dee4f1d
1 changed files with 8 additions and 6 deletions

View File

@ -840,12 +840,14 @@
// }
query.select(idView).boundingClientRect();
query.exec(function(res) {
var top = res[0].top;
var height = res[0].height;
topArr.push(top);
heightArr.push(height);
that.$set(that, 'topArr', topArr);
that.$set(that, 'heightArr', heightArr);
if(Array.isArray(res) && res.length > 0 && res[0]){
var top = res[0].top;
var height = res[0].height;
topArr.push(top);
heightArr.push(height);
that.$set(that, 'topArr', topArr);
that.$set(that, 'heightArr', heightArr);
}
});
};
},