We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类似接口请求方式下载文件:
/** * 使用 fetch/ajax 下载在线图片/文件 * @param {*} url 文件地址 * @param {*} filename 文件名称 */ function download(url, filename) { return fetch(url).then(res => res.blob().then(blob => { let a = document.createElement('a'); let url = window.URL.createObjectURL(blob); a.href = url; a.download = filename; a.click(); window.URL.revokeObjectURL(url); })) }
下载 base64、文件流等
/** * @param {*} fileBlob 文件流 * @param {*} filename 文件名称 * @description 导出下载订单 */ function exportDownload(fileBlob, filename) { let elink = document.createElement('a'); elink.download = filename; elink.href = fileBlob; elink.click(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
类似接口请求方式下载文件:
下载 base64、文件流等
The text was updated successfully, but these errors were encountered: