riku
5 天以前 f19e5267cc23b1c714dc746239864f33ed715dd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<template>
  <iframe ref="pdfPreview" width="100%" height="100vh" style="height: 100vh;"></iframe>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from "vue-router";
 
const props = defineProps({
  pdfUrl: String
})
 
const route = useRoute();
const router = useRouter();
 
const pdfPreview = ref(null)
 
function getQueryParam(name) {
  route.query.data
  const queryString = window.location.search;
  const urlParams = new URLSearchParams(queryString);
  return urlParams.get(name);
}
 
onMounted(() => {
  pdfPreview.value.src = props.pdfUrl
 
})
</script>