import React from 'react';
import { saveAs } from 'file-saver';
const PdfDownloader = ({ files }) => {
const downloadAll = () => {
files.forEach(file => {
fetch(file)
.then(res => res.blob())
.then(data => {
saveAs(data, file);
});
});
};
return <button onClick={downloadAll}>Download All</button>;
};
export default PdfDownloader;
使用react实现pdf文件的批量下载
最新推荐文章于 2024-05-23 09:56:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)