Comparing version 2.0.4 to 3.0.0
{ | ||
"name": "vue-pdf", | ||
"version": "2.0.4", | ||
"version": "3.0.0", | ||
"description": "vue.js pdf viewer", | ||
@@ -23,5 +23,5 @@ "main": "src/pdf.vue", | ||
"dependencies": { | ||
"pdfjs-dist": "^2.0.183", | ||
"pdfjs-dist": "^2.0.250", | ||
"vue-resize-sensor": "^2.0.0" | ||
} | ||
} |
@@ -60,6 +60,6 @@ # vue-pdf | ||
#### @pageLoaded <sup>Number<sup> | ||
#### @page-loaded <sup>Number<sup> | ||
Triggered when a page is loaded. | ||
#### @numPages <sup>Number<sup> | ||
#### @num-pages <sup>Number<sup> | ||
The total number of pages of the pdf. | ||
@@ -85,2 +85,34 @@ | ||
##### example - current page / page count | ||
``` | ||
<template> | ||
<div> | ||
{{currentPage}} / {{pageCount}} | ||
src="https://cdn.mozilla.net/pdfjs/tracemonkey.pdf" | ||
@num-pages="pageCount = $event" | ||
@page-loaded="currentPage = $event" | ||
></pdf> | ||
</div> | ||
</template> | ||
<script> | ||
import pdf from 'vue-pdf' | ||
export default { | ||
components: { | ||
}, | ||
data() { | ||
return { | ||
currentPage: 0, | ||
pageCount: 0, | ||
} | ||
} | ||
} | ||
</script> | ||
``` | ||
##### example with multiple pages | ||
@@ -108,3 +140,3 @@ ``` | ||
<div v-if="loadedRatio > 0 && loadedRatio < 1" style="background-color: green; color: white; text-align: center" :style="{ width: loadedRatio * 100 + '%' }">{{ Math.floor(loadedRatio * 100) }}%</div> | ||
<pdf v-if="show" ref="pdf" style="border: 1px solid red" :src="src" :page="page" :rotate="rotate" @password="password" @progress="loadedRatio = $event" @error="error" @numPages="numPages = $event"></pdf> | ||
<pdf v-if="show" ref="pdf" style="border: 1px solid red" :src="src" :page="page" :rotate="rotate" @password="password" @progress="loadedRatio = $event" @error="error" @num-pages="numPages = $event"></pdf> | ||
</div> | ||
@@ -111,0 +143,0 @@ </div> |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20877
201
Updatedpdfjs-dist@^2.0.250