当前位置:网站首页>[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);
});
},
边栏推荐
- 毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
- Friends circle community program source code sharing
- 使用多线程Callable查询oracle数据库
- Talents come from afar, and Wangcheng district has consolidated the intellectual base of "strengthening the provincial capital"
- Using multithreaded callable to query Oracle Database
- Comprehensive usage and case questions of sub query of SQL data analysis [patient sorting]
- Leetcode skimming: stack and queue 06 (top k high-frequency elements)
- SQL数据分析之窗口排序函数rank、dense_rank、raw_number与lag、lead窗口偏移函数【用法整理】
- [wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login
- Picture puzzle wechat applet source code_ Support multi template production and traffic master
猜你喜欢
Example explanation: move graph explorer to jupyterlab
gradle
2022 low voltage electrician examination questions and answers
Leetcode skimming: stack and queue 04 (delete all adjacent duplicates in the string)
Guide d'installation du serveur SQL
Barbie q! How to analyze the new game app?
数据库--SqlServer详解
excel数据透视表
Asp . Text of automatic reply to NETCORE wechat subscription number
New version of free mobile phone, PC, tablet, notebook four terminal Website thumbnail display diagram online one click to generate website source code
随机推荐
Is the securities account given by qiniu business school safe? Where can I open an account
Some understandings of graph convolution neural network r-gcn considering relations and some explanations of DGL official code
Data analysis methodology and previous experience summary [notes dry goods]
2022拼多多详情/拼多多商品详情/拼多多sku详情
AIX存储管理之卷组的创建(一)
数据库--SqlServer详解
heketi 记录
Kyushu cloud and Intel jointly released the smart campus private cloud framework, enabling new infrastructure for education
Common loss function of deep learning
【js通过url下载文件】
How to open an account for individual stock speculation? Is it safe?
2022 low voltage electrician examination questions and answers
Is it safe to buy funds in a securities account? Where can I buy funds
Leetcode skimming: stack and queue 06 (top k high-frequency elements)
SQL数据分析之流程控制语句【if,case...when详解】
程序员该如何更好的规划自己的职业发展?
Asp . Text of automatic reply to NETCORE wechat subscription number
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details
From 20s to 500ms, I used these three methods