index.vue 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <VuePdfEmbed
  3. :source="pdfSource"
  4. annotation-layer
  5. text-layer
  6. @click="showPdf"
  7. />
  8. <el-drawer
  9. v-model="visible"
  10. :footer="false"
  11. :header="false"
  12. :show-close="false"
  13. destroy-on-close
  14. direction="rtl"
  15. size="972px"
  16. >
  17. <VuePdfEmbed :source="pdfSource" annotation-layer text-layer />
  18. </el-drawer>
  19. </template>
  20. <script lang="ts" setup>
  21. import VuePdfEmbed from "vue-pdf-embed";
  22. // essential styles
  23. import "vue-pdf-embed/dist/style/index.css";
  24. // optional styles
  25. import "vue-pdf-embed/dist/style/annotationLayer.css";
  26. import "vue-pdf-embed/dist/style/textLayer.css";
  27. // either URL, Base64, binary, or document proxy
  28. const props = defineProps({
  29. pdfSource: {
  30. type: String,
  31. required: true,
  32. },
  33. });
  34. const visible = ref(false);
  35. const showPdf = () => {
  36. visible.value = true;
  37. };
  38. </script>
  39. <style lang="scss" scoped></style>