当前位置:网站首页>【js通过url下载文件】
【js通过url下载文件】
2022-07-02 00:30:00 【six-double-seven】
js通过url下载文件
- 下载文件的代码如下
exportTable(){
api.exportOrder(this.query)
.then(res => {
setTimeout(() => {
if (res && res.code === 1) {
const a = document.createElement('a');
a.href = res.exportUrl;
a.download = '文件名称';
document.body.appendChild(a);
a.click();
URL.revokeObjectURL(res.exportUrl);
a.remove();
this.$Message.success("下载完成");
}else {
this.$Message.error(res.msg);
}
}, 1000);
})
.catch(err => {
this.$Message.error('导出失败:' + err);
});
},
边栏推荐
- UDS bootloader of s32kxxx bootloader
- Talents come from afar, and Wangcheng district has consolidated the intellectual base of "strengthening the provincial capital"
- I want to ask, which is the better choice for securities companies? I don't understand. Is it safe to open an account online now?
- Leetcode skimming: stack and queue 02 (realizing stack with queue)
- SQL数据分析之流程控制语句【if,case...when详解】
- When installing mysql, there are two packages: Perl (data:: dumper) and Perl (JSON)
- What does open loop and closed loop mean?
- Flow control statement of SQL data analysis [if, case... When detailed]
- 挖财学堂开户打新债安全可靠嘛?
- 毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
猜你喜欢
PWN attack and defense world cgpwn2
Openvino model performance evaluation tool DL workbench
下载在线视频 m3u8使用教程
Halcon knowledge: an attempt of 3D reconstruction
Jielizhi, production line assembly link [chapter]
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
LeetCode中等题题分享(5)
export default 导出的对象,不能解构问题,和module.exports的区别
Data analysis methodology and previous experience summary [notes dry goods]
Qt5.12.9 migration tutorial based on Quanzhi H3
随机推荐
Cmake engineering related
Is it safe and reliable to open an account in Caixue school and make new debts?
回顾数据脱敏系统
求逆序数的三个方法
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
BPR (Bayesian personalized sorting)
Kuberntes cloud native combat high availability deployment architecture
如何提升数据质量
【CTF】bjdctf_2020_babystack2
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
The origin of usb-if Association and various interfaces
2022拼多多详情/拼多多商品详情/拼多多sku详情
2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details
449 original code, complement code, inverse code
The difference between timer and scheduledthreadpoolexecutor
在证券账户上买基金安全吗?哪里可以买基金
Node -- add compressed file
mysql之B tree 以及 B+tree
LDR6035智能蓝牙音响可对手机设备持续充放电方案
Jielizhi Bluetooth headset quality control and production skills [chapter]