getBase64Image(img) { let canvas = document.getElementById('myCanvas') let ctx = canvas.getContext('2d') ctx.drawImage(img, 0, 0, 592, 333) let ext = img.src.substring(img.src.lastIndexOf('.') + 1).toLowerCase() let dataURL = canvas.toDataURL('image/' + ext) return dataURL },
let image = new Image() image.crossOrigin = '' image.src = obj.img image.onload = function () { let base64 = that.getBase64Image(image) console.log(base64) that.imgShow = base64 }