图片获取base地址

 beforeAvatarUpload(file) {
     
      let reader = new FileReader()
      reader.readAsDataURL(file)  
      let img
      var that = this
      reader.onloadend = function() {
     
        img = reader.result  
       
      }
     }
   <img v-if="imgBase64"
                 :src="`data:image/png;base64,`+ imgBase64"
                 class="avatar">

你可能感兴趣的:(个人)