踩坑写法:
const img1 = new Image()
img1.src = this.materialUrl
console.log('img1.width, img1.height', img1.width, img1.height)
打印结果:
踩坑写法:
const img1 = new Image()
img1.src = this.materialUrl
console.log('img1.width, img1.height', img1.width, img1.height)
打印结果: