本文介绍了在 vue.js 中嵌入完整的 Mozilla pdf.js 查看器(通过 vue-cli 使用 webpack)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..我想嵌入 完整的 Mozilla pdf.js 查看器 在 Vue SPA 中.
I would like to embed the full Mozilla pdf.js viewer in a Vue SPA.
这个 SO 问题 有一个可接受的答案,但我无法使其工作.我也收到了 Uncaught SyntaxError: Unexpected token <
错误,就像评论中的某个人一样.
This SO question has an accepted answer but I cannot make it work. I also get the Uncaught SyntaxError: Unexpected token <
error like someone in the comments.
我还发现了一些 npm 包,它们似乎具有相同的用途,但我也无法使它们工作:
I also found a few npm packages that seem to serve the same purpose but I couldn't make them work either:
pdf.js-viewerpdfjs-dist-viewer-min任何帮助将不胜感激!
推荐答案
我遇到了同样的错误并修复了它.你会试试下面吗?
I had same error and fixed it. would you try bellow?
・固定工人的路径
・残疾工人
window.PDFJS.workerSrc = require('pdf.js-viewer/pdf.worker');
window.PDFJS.disableWorker = true;
这篇关于在 vue.js 中嵌入完整的 Mozilla pdf.js 查看器(通过 vue-cli 使用 webpack)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论