Browse Source

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

汤世哲 3 months ago
parent
commit
b7f7face2c
1 changed files with 3 additions and 1 deletions
  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 {
         const loadingTask = pdfjsLib.getDocument({
           url: pdfUrl,
-          disableRange: true
+          disableRange: true,
+          disableAutoFetch: true // 启动自动分块加载
         })
+        pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs-dist/build/pdf.worker.mjs'
         this.pdf = await loadingTask.promise
         this.totalPages = this.pdf.numPages
         this.currentPage = 1