当前位置:网站首页>js函数调用下载文件链接
js函数调用下载文件链接
2022-07-24 10:22:00 【前端老实人】
属于自己调用自己
let downloadElement = document.createElement('a')
let href = window.URL.createObjectURL(res.data) //创建下载的链接
downloadElement.href = href
downloadElement.download = '校对文章.doc' //下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click() //点击下载
document.body.removeChild(downloadElement) //下载完成移除元素
window.URL.revokeObjectURL(href) //释放掉blob对象边栏推荐
- [robot learning] mechanism kinematics analysis and MATLAB simulation (3D model +word report +matlab program)
- 脚手架文件目录说明、文件暴露
- fatal: unable to commit credential store: Device or resource busy
- [STM32 learning] (12) STM32 realizes LCD1602 simple static reality
- Add a love power logo to your website
- Deployment and analysis of coredns
- 高精尖中心论文入选国际顶会ACL 2022,进一步拓展长安链隐私计算能力
- Taurus. How to upgrade and run MVC on net6 and net7
- The best time to buy and sell stocks (leetcode-121)
- ZOJ 2770 differential restraint system -- 2 -- May 20, 2022
猜你喜欢

给你的网站加一个爱发电角标

Simply use golang SQLC to generate MySQL query code

NiO knowledge points

图像处理:RGB565转RGB888

Create a vertical seekbar from scratch

Server load and CPU performance tuning

How does ribbon get the default zoneawareloadbalancer?

Home raiding III (leetcode-337)

What is NFT? How to develop NFT system?

The best time to buy and sell stocks Ⅲ (leetcode-123)
随机推荐
常量指针、指针常量
Activity exception lifecycle
Create a vertical seekbar from scratch
In the envy of LETV, there is a "meaning crisis" of contemporary workers
Common Unicode encoding range
[STM32 learning] (5) press the key to control the flow light (interrupt Implementation)
cannot unpack non-iterable NoneType object
SMTP automatic mail sending function code
Jenkins deploys the project and prompts that the module package defined by him cannot be found
Tree array-
Source insight 3.5 comment garbled
Balance between management / business and technology
[correcting Hongming] what? I forgot to take the "math required course"!
Scaffold document directory description and document exposure
Dynamic programming -- a collection of stock problems
[STM32 learning] (11) STM32 Mifare_ Use of one (S50) m1s50 (read, write, key modification, control bit interpretation)
Simple parsing JSON strings with regular expressions
Exception: pyqtgraph requires Qt version >= 5.12 (your version is 5.9.5)
[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus
Build a live broadcast platform based on webrtc