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-03-22 10:46:17 发布