<el-upload
              class="upload-demo"
              ref="vidos"
              :action="URL+'/api/post/file'"
              :data="date"
              :on-success="handleAvatarAUDIO"
              :before-upload="beforeAvatarAUDIO"
              :on-progress="beforeAvatarUpload"
              accept=".mp4"
              :on-change="AvatarAUDIO" //将用到次方法
              :file-list="fileList"
            >    

 

   AvatarAUDIO(file, fileList){
      // 此方法如果是大文件时会出现偶尔卡顿
      let reader = new FileReader()
      reader.readAsDataURL(file.raw)
      reader.onload=()=>{
          console.log(reader.result,'地址')
          this.AUDIO = reader.result
      }
      // 第二种方法
      let URL = window.URL || window.webkitURL;
      this.AUDIO = URL.createObjectURL(file.raw);

    },

  

相关文章:

  • 2022-03-02
  • 2021-12-12
  • 2021-12-12
  • 2021-10-06
  • 2022-12-23
  • 2021-05-25
  • 2021-05-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
相关资源
相似解决方案