返回的数据

返回ArrayBuffer数据下载

 

 

 

const blob = new Blob([response.data]);
            if ('download' in document.createElement('a')) {
                const elink = document.createElement('a');
                elink.download = fileName;
                elink.style.display = 'none';
                elink.href = URL.createObjectURL(blob);
                document.body.appendChild(elink);
                elink.click();
                URL.revokeObjectURL(elink.href);
                document.body.removeChild(elink);
            } else {
                navigator.msSaveBlob(blob, fileName);
            }

 

相关文章:

  • 2021-11-14
  • 2021-08-07
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
猜你喜欢
  • 2022-12-23
  • 2021-04-12
  • 2022-02-07
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-09-09
相关资源
相似解决方案