瀏覽代碼

Merge branch 'dev/v1.1.1_tsz' of jianyu/web into feature/v1.1.1

汤世哲 3 月之前
父節點
當前提交
b7f7face2c
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      apps/mobile/src/views/common/pdfViewExample.vue

+ 3 - 1
apps/mobile/src/views/common/pdfViewExample.vue

@@ -63,8 +63,10 @@ export default {
       try {
       try {
         const loadingTask = pdfjsLib.getDocument({
         const loadingTask = pdfjsLib.getDocument({
           url: pdfUrl,
           url: pdfUrl,
-          disableRange: true
+          disableRange: true,
+          disableAutoFetch: true // 启动自动分块加载
         })
         })
+        pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs-dist/build/pdf.worker.mjs'
         this.pdf = await loadingTask.promise
         this.pdf = await loadingTask.promise
         this.totalPages = this.pdf.numPages
         this.totalPages = this.pdf.numPages
         this.currentPage = 1
         this.currentPage = 1