优化Pdf

master
LiuJiaNan 2025-12-17 16:56:26 +08:00
parent 7cc931b9da
commit d3387af852
1 changed files with 1 additions and 4 deletions

View File

@ -22,10 +22,7 @@ function Pdf(props) {
const [pdfWidth, setPdfWidth] = useState(600);
const [loading, setLoading] = useState(true);
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
"pdfjs-dist/build/pdf.worker.min.mjs",
import.meta.url,
).toString();
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
const onDocumentLoadSuccess = ({ numPages }) => {
setNumPages(numPages);