loadImg (url) {
let img = new Image()
img.src = url
let that = this
img.onload = function () {
if (img.width / img.height > 1000 / 600) {
that.fix = 'widthFix'
} else {
that.fix = 'heightFix'
}
}
},
其中img的width和height就是原始宽高。
url是图片的网络地址