优化Pdf
parent
7cc931b9da
commit
d3387af852
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue