<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>
|