From d77ff074e895d16b99f72386dd50655500cdb435 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期四, 04 七月 2024 18:19:05 +0800
Subject: [PATCH] fix:文件大小写问题
---
src/components/PDFViewer/index.vue | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/src/components/PDFViewer/index.vue b/src/components/PDFViewer/index.vue
new file mode 100644
index 0000000..bb10852
--- /dev/null
+++ b/src/components/PDFViewer/index.vue
@@ -0,0 +1,41 @@
+<template>
+ <div class="pdf-container">
+ <iframe :src="fileUrl" width="100%" height="100%"></iframe>
+ </div>
+</template>
+
+<script setup>
+import { ref, onMounted } from 'vue';
+
+const props = defineProps({
+ pdfUrl: {
+ type: String,
+ required: true
+ }
+});
+const viewerUrl = '/pdfjs/web/viewer.html?file='; // pdfjs鏂囦欢鍦板潃
+
+const fileUrl = ref('');
+
+
+const renderPDF = () => {
+ fileUrl.value = viewerUrl + encodeURIComponent(props.pdfUrl);
+};
+
+onMounted(() => {
+ renderPDF();
+})
+
+</script>
+
+<style lang="scss" scoped>
+.pdf-container {
+ width: 100%;
+ height: 100%;
+
+ .pdf-canvas {
+ width: 100%;
+ height: 100%;
+ }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0