当前位置:网站首页>[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);
});
},
边栏推荐
- Leetcode question brushing: stack and queue 07 (maximum value of sliding window)
- It's nothing to be utilitarian!
- SQL Server Installation Guide
- RFID让固定资产盘点更快更准
- Is it safe and reliable to open an account in Caixue school and make new debts?
- Picture puzzle wechat applet source code_ Support multi template production and traffic master
- Weather forecast applet source code weather wechat applet source code
- Data analysis methodology and previous experience summary [notes dry goods]
- 使用 ES 实现疫情地图或者外卖点餐功能(含代码及数据)
- [bottom pop-up selector] uniapp picker component - scroll selector popped up at the bottom
猜你喜欢

2023 Lexus ES products have been announced, which makes great progress this time

Intelligent operation and maintenance practice: banking business process and single transaction tracking

Halcon knowledge: an attempt of 3D reconstruction

Use es to realize epidemic map or take out order function (including code and data)

【底部弹出-选择器】uniapp Picker组件——底部弹起的滚动选择器

excel数据透视表

Leetcode96 different binary search trees

2022 operation of simulated examination platform for melting welding and thermal cutting work license

如何提升数据质量

4. Object mapping Mapstercover
随机推荐
2022拼多多详情/拼多多商品详情/拼多多sku详情
Leetcode skimming: stack and queue 05 (inverse Polish expression evaluation)
Leetcode skimming: stack and queue 01 (realizing queue with stack)
It's nothing to be utilitarian!
Data analysis methodology and previous experience summary [notes dry goods]
九州云与英特尔联合发布智慧校园私有云框架,赋能教育新基建
基于全志H3的QT5.12.9移植教程
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
Node——Egg 创建本地文件访问接口
数据分析方法论与前人经验总结【笔记干货】
What does open loop and closed loop mean?
B tree and b+tree of MySQL
数据库--SqlServer详解
Download the online video m3u8 tutorial
Ldr6035 smart Bluetooth audio can continuously charge and discharge mobile devices
Using multithreaded callable to query Oracle Database
工作中非常重要的测试策略,你大概没注意过吧
一名优秀的软件测试人员,需要掌握哪些技能?
JS common library CDN recommendation
New version of free mobile phone, PC, tablet, notebook four terminal Website thumbnail display diagram online one click to generate website source code