File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import { VPdfViewer } from ' @vue-pdf-viewer/viewer' ;
2
+ import { onBeforeMount , watch , ref } from " vue" ;
3
+ import { VPdfViewer , useLicense } from " @vue-pdf-viewer/viewer" ;
4
+
5
+ const vpvRef = ref <InstanceType <typeof VPdfViewer > | null >(null );
6
+ onBeforeMount (() => {
7
+ useLicense ({ licenseKey: " your-license-key" });
8
+ });
9
+ watch (
10
+ vpvRef ,
11
+ (newVal ) => {
12
+ console .log (" These are VPV instance properties" , Object .keys (newVal ));
13
+ },
14
+ { deep: true }
15
+ );
3
16
</script >
4
17
<template >
5
- <VPdfViewer
6
- v-bind =" $attrs"
7
- src =" https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" />
18
+ <VPdfViewer
19
+ v-bind =" $attrs"
20
+ ref =" vpvRef"
21
+ src =" https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" />
8
22
</template >
You can’t perform that action at this time.
0 commit comments