// 获取图片高度
this.$nextTick(async () => {
let src = this.imageUrlPrex + this.details.pics[0];
src = await uni.getImageInfo({
src
})
let height = src[1].height
let width = src[1].width
let scale = (height / width).toFixed(2)
console.log(src[1].height, scale, src[1], '火速')
})
注意:要等图片渲染完成异步去获取