Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/TaTo30/vue-pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
TaTo30 committed Sep 8, 2024
2 parents efe49b4 + 900c710 commit f8f9021
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vue-pdf/src/components/VuePDF.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- eslint-disable no-case-declarations -->
<script setup lang="ts">
import * as PDFJS from 'pdfjs-dist'
import { computed, onMounted, ref, toRaw, watch } from 'vue'
import { computed, onMounted, onUnmounted, ref, toRaw, watch } from 'vue'

import 'pdfjs-dist/web/pdf_viewer.css'

Expand Down Expand Up @@ -279,6 +279,11 @@ onMounted(() => {
initDoc(props.pdf)
})

onUnmounted(() => {
// Abort all network process and terminates the worker
props.pdf?.destroy()
})

// Exposed methods
function reload() {
renderPage(props.page)
Expand Down

0 comments on commit f8f9021

Please sign in to comment.