【文件属性】:
文件名称:m-下载:本机JS的Blob流文件下载
文件大小:6KB
文件格式:ZIP
更新时间:2021-03-04 10:12:32
JavaScript
安装和导入
使用npm
npm install m-downloads
使用纱
yarn add m-downloads
ES6导入模式
import Download from 'm-downloads'
使用范例
GET请求
const downloader = new Download ( '/api/download' , {
method : 'GET' ,
filename : 'Custom file name' ,
} )
downloader
. catch ( error => { console . log ( error ) } )
. finally ( ( ) => console . log ( 'A successful or failed operation, such as the handling of loading' ) )
【文件预览】:
m-downloads-master
----.gitignore(231B)
----es()
--------index.js(2KB)
----README.md(4KB)
----package.json(973B)
----.babelrc(144B)
----lib()
--------index.js(7KB)