@@ -45,8 +45,9 @@ import {
4545 BookmarkView , Annotation , ThumbnailView , Print , TextSelection ,
4646 TextSearch , FormFields , FormDesigner , PageOrganizer
4747} from ' @syncfusion/ej2-vue-pdfviewer' ;
48- import { provide } from ' vue' ;
48+ import { provide , ref } from ' vue' ;
4949
50+ const pdfviewer = ref (null );
5051const documentPath = " https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" ;
5152const resourceUrl = ' https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib' ;
5253
@@ -55,7 +56,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
5556
5657const documentLoad = () => {
5758 document .getElementById (' set' ).addEventListener (' click' , () => {
58- this . $refs . pdfviewer .ej2Instances .annotation .setAnnotationMode (' FreeText' );
59+ pdfviewer . value .ej2Instances .annotation .setAnnotationMode (' FreeText' );
5960 });
6061}
6162
@@ -125,8 +126,9 @@ import {
125126 BookmarkView , Annotation , ThumbnailView , Print , TextSelection ,
126127 TextSearch , FormFields , FormDesigner , PageOrganizer
127128} from ' @syncfusion/ej2-vue-pdfviewer' ;
128- import { provide } from ' vue' ;
129+ import { provide , ref } from ' vue' ;
129130
131+ const pdfviewer = ref (null );
130132const serviceUrl = " https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" ;
131133const documentPath = " https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" ;
132134
@@ -135,7 +137,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
135137
136138const documentLoad = () => {
137139 document .getElementById (' set' ).addEventListener (' click' , () => {
138- this . $refs . pdfviewer .ej2Instances .annotation .setAnnotationMode (' FreeText' );
140+ pdfviewer . value .ej2Instances .annotation .setAnnotationMode (' FreeText' );
139141 });
140142}
141143
0 commit comments