downloadExcel() {
      
      this.$ajax
        .post(
          downloadExcelTemplateProte, //接口
          data, //参数
          {responseType: "blob"} //数据返回类型
        )
        .then((res) => {
          let url = window.URL.createObjectURL(new Blob([res.data]));
          let link = document.createElement("a");
          link.style.display = "none";
          link.href = url;
          link.setAttribute("download", "all_sample_fa_kegg_blast_bst.xls"); //指定下载后的文件名,防跳转
          document.body.appendChild(link);
          link.click();
        })
        .catch(function (error) {
          console.log(error);
        });
    }
   
链接:https://www.jianshu.com/p/c81a03b0a349 

相关文章:

  • 2021-07-18
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
相关资源
相似解决方案