Category : image

I’ve been triying to return a string in a reader.onloadend but it keeps me returning my entire function. my function below: uploadFile() { let vm = this; var file = vm.$refs["testeLogo"].files[0]; var reader = new FileReader(); reader.onloadend = function() { console.log(reader.result); // returns me a string base64 document.querySelector("#supe").setAttribute("src", this.imagem); return reader.result; }; reader.readAsDataURL(file); } How ..

Read more