downFiles 下载文件方法
全局使用 (推荐)
局部使用
const res = await req.downFiles({
path: "http://pic.topmeizi.com/wp-content/uploads/2017a/04/08/01.jpg",
})
1.简单使用
2.带下载提示
const res = await this.$req.downFiles({
path: 'http://localhost:10086/static/hhyang.txt',
title: "正在下载"
})
3.带拦截下载
4.带额外参数下载
const res = await this.$req.downFiles({
title: "正在下载",
name:'hhyang',
ages:'21'
})
console.log(res)
5.带进度条下载
6.自定义header
path: 'http://localhost:10086/static/hhyang.txt',
title: "正在下载",
header:{
"Content-Type":"text/plain; charset=UTF-8"
}
console.log(res)