<div class="file-wrapper">
<img class="file-position" src="1.jpg" alt="" ref="imgSize" @onload="imgload">
</div>
mounted(){
this.fileUrl = this.$route.query.file || ""
//
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
console.log(clientHeight);
this.imgload();
},
methods:{
imgload(){
let imgSize = this.$refs["imgSize"].offsetHeight;
console.log(imgSize);
}
}
how do I get the height of the loaded picture (the width and height of the picture is unknown) the value obtained by imgSize is different from the real one?