当前位置:网站首页>[JS download files through url]
[JS download files through url]
2022-07-02 00:41:00 【six-double-seven】
js adopt url Download the file
- The code for downloading the file is as follows
exportTable(){
api.exportOrder(this.query)
.then(res => {
setTimeout(() => {
if (res && res.code === 1) {
const a = document.createElement('a');
a.href = res.exportUrl;
a.download = ' File name ';
document.body.appendChild(a);
a.click();
URL.revokeObjectURL(res.exportUrl);
a.remove();
this.$Message.success(" Download complete ");
}else {
this.$Message.error(res.msg);
}
}, 1000);
})
.catch(err => {
this.$Message.error(' Export failed :' + err);
});
},
边栏推荐
- Kyushu cloud and Intel jointly released the smart campus private cloud framework, enabling new infrastructure for education
- gradle
- 4. Object mapping Mapstercover
- 使用 ES 实现疫情地图或者外卖点餐功能(含代码及数据)
- To meet the needs of consumers in technological upgrading, Angel water purifier's competitive way of "value war"
- Kuberntes cloud native combat high availability deployment architecture
- AIX存储管理之逻辑卷的创建及属性的查看和修改
- ThreadLocal内存泄漏是什么,怎么解决
- How to type spaces in latex
- 【CTF】bjdctf_ 2020_ babystack2
猜你喜欢
heketi 记录
Promise和模块块化编程
如何提升数据质量
How do Lenovo computers connect Bluetooth headsets?
King combat power query renamed toolbox applet source code - with traffic main incentive advertisement
Use es to realize epidemic map or take out order function (including code and data)
[leetcode] number of maximum consecutive ones
SQL Server Installation Guide
Leetcode96 different binary search trees
[wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login
随机推荐
Promise和模块块化编程
Leetcode 96 différents arbres de recherche binaires
heketi 记录
Source code of Qiwei automatic card issuing system
Leetcode skimming: stack and queue 02 (realizing stack with queue)
Is the securities account given by qiniu business school safe? Where can I open an account
excel查找与引用函数
Otaku wallpaper Daquan wechat applet source code - with dynamic wallpaper to support a variety of traffic owners
AIX存储管理之卷组属性的查看和修改(二)
JS -- image to base code, base to file object
[opencv450] hog+svm and hog+cascade for pedestrian detection
2022 safety officer-b certificate examination practice questions simulated examination platform operation
Linux centos7 installation Oracle11g super perfect novice tutorial
AIX存储管理之逻辑卷的创建及属性的查看和修改
使用多线程Callable查询oracle数据库
Bc35 & bc95 onenet mqtt (old)
2023 Lexus ES products have been announced, which makes great progress this time
Leetcode skimming: stack and queue 03 (valid parentheses)
Take the enclave Park as a sample to see how Yuhua and Shaoshan play the song of Chang Zhu Tan integrated development
智能运维实战:银行业务流程及单笔交易追踪