const {width, height} = await this.getImgSize(base64)
async getImgSize(base64) { const image = new Image() image.crossOrigin = '' image.src = base64 return new Promise((resolve, reject) => { image.onload = () => { const {width, height} = image resolve({width, height}) } }) },
标签:const,image,base64,宽高,JS,width,height From: https://www.cnblogs.com/shining-feifan/p/16866078.html