diff --git a/yudao-ui-app/pages/goods_details/index.vue b/yudao-ui-app/pages/goods_details/index.vue index 247bd0960..22a18ab7c 100644 --- a/yudao-ui-app/pages/goods_details/index.vue +++ b/yudao-ui-app/pages/goods_details/index.vue @@ -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); + } }); }; },