changeFile(file, fileList) { var This = this; //this.imageUrl = URL.createObjectURL(file.raw); var reader = new FileReader(); reader.readAsDataURL(file.raw); reader.onload = function(e){ this.result // 这个就是base64编码了 This.imageUrl = this.result; } }
changeFile(file, fileList) { var This = this; //this.imageUrl = URL.createObjectURL(file.raw); var reader = new FileReader(); reader.readAsDataURL(file.raw); reader.onload = function(e){ this.result // 这个就是base64编码了 This.imageUrl = this.result; } }