vue-pdf
vue-pdf copied to clipboard
Question:when did the pdf finish rendering ?
I have a v-if directive for destroy the pdf component., and refresh it. buttonOpen1 @click="disp", buttonOpen2 @click="disp", buttonOpen3 @click="disp", btnClose @click="closeDialog"
<dialog>
<v-flex v-if="reloaded">
<pdf v-for="i in numPages"
:key="i"
:src="pdfSrc"
@progress="loadedRatio = $event"
:page="i"></pdf>
</v-card-text>
</flex>
</dialog>
method:
disp : fuction(){
this.pdfSrc = filePath +filename
pdf.createLoadingTask({ url: this.pdfSrc, CMapReaderFactory }).then(
(pdf) => {
this.numPages = pdf.numPages
this.reloaded=true
}
)
}
closeDialog : fuction(){
this.reloaded=false
...
}
When I clicked btnClose a little faster, next time, btnOpen1 will get a whole white blank dialog page. So could you help me for this question. How can I know when all of pages of the pdf are rendered completely. Is there a event I could use for ? Thank you.
怎么解决呢 我也遇到此问题