二进制文件流处理笔记

res的形式

   let a = document.createElement("a")
   let blob = new Blob([res], {
    
    
      type: "application/vnd.ms-excel", //将会被放入到blob中的数组内容的MIME类型
   })
   let objectUrl = URL.createObjectURL(blob) //生成一个url
   a.setAttribute("href", objectUrl)
   a.setAttribute("download", "盘点模板.xls")
   a.click()

猜你喜欢

转载自blog.csdn.net/qq_43485006/article/details/106266316