PdfViewer.vue 471 B

12345678910111213141516171819
  1. <template>
  2. <iframe :src="pdfjsAddr + `?file=${encodeURIComponent(props.src)}`" frameborder="0"
  3. :style="{ height: props.parentHeight + 'px' }"></iframe>
  4. </template>
  5. <script setup>
  6. const props = defineProps({ src: { type: String, default: "" }, parentHeight: Number })
  7. import { pdfjsAddr } from '@/utils/config';
  8. </script>
  9. <style lang="less" scoped>
  10. iframe {
  11. width: 100%;
  12. // height: 1000px;
  13. // box-sizing: margin-box;
  14. margin: 0px;
  15. padding: 0px;
  16. }
  17. </style>