当前位置:   article > 正文

上传文件new Blob_new blob type参数

new blob type参数

const elink = document.createElement('a')

 let jsonFile = JSON.stringify(res, null, 2)

elink.download = '模板'

const blob = new Blob([jsonFile],{ type: 'application/vnd.ms-excel'})

elink.href = URL.createObjectURL(blob)

document.body.appendChild(elink)

elink.click()

document.body.removeChild(elink)

newBlob第一个参数是个数组 size和type属性 第二个参数是个对象 type设置文件类型

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/144952
推荐阅读
相关标签
  

闽ICP备14008679号