<img :src="imgUrl" alt="" ref="imgRes" v-show="false"/>
var reader = new FileReader();
reader.readAsDataURL(f); // f =》上传图片<input type = 'file'> @change获取的
reader.onload = function () {
console.log(reader);
console.log(reader.result) // 拿到图片
};
this.$refs.imgRes.onload = function () { // 通过this.width 和 this.height可以获取到}
如果是video标签通过onloadedmetadata事件获取宽高 // 通过this.videoWidth取