尝试安装pdf.js
This commit is contained in:
parent
00418e1c02
commit
316b7f1e05
3 changed files with 11 additions and 0 deletions
|
@ -48,6 +48,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'App',
|
||||
|
@ -62,5 +63,9 @@ export default defineComponent({
|
|||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
|
||||
pdfjsLib.getDocument('https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/examples/learning/helloworld.pdf');
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue