zoukankan      html  css  js  c++  java
  • axios导出 excel

    this.axios({
      methods: 'get',
      url: url,
      responseType: 'blob'
    }).then(res => {
      const blob = new Blob([res])
      const fileName = '导出信息.xls'
      if ('download' in document.createElement('a')) { // 非IE下载
        const elink = document.createElement('a')
        elink.download = fileName
        elink.style.display = 'none'
        elink.href = URL.createObjectURL(blob)
        document.body.appendChild(elink)
        elink.clink()
        URL.revokeObjectURL(elink.href) // 释放URL 对象
        document.body.removeChild(elink)
      } else { // IE10+下载
        navigator.msSaveBlob(blob, fileName)
      }
    })
  • 相关阅读:
    靶机练习
    靶机练习
    靶机练习
    CTF-攻防世界-Web_php_unserialize(PHP反序列化)
    漏洞复现
    靶机练习
    靶机练习
    靶机练习
    糗事集合
    慕课前端入门-JS事件
  • 原文地址:https://www.cnblogs.com/ToBeBest/p/10150571.html
Copyright © 2011-2022 走看看