TaTo30 / vue-pdf

PDF component for Vue 3
https://tato30.github.io/vue-pdf/
MIT License
472 stars 65 forks source link

The destroying on unmount is too aggressive #156

Closed ZachHandley closed 1 month ago

ZachHandley commented 1 month ago

I am trying to use this in a multi-stepped process with a PDF, and it keeps destroying the entire damn source ref from the parent component along with the PDF component. I am literally just trying to show it on two different pages, and it's aggressively destroying the source so. I can fetch it on each step (a 7+MB PDF) or I can ??? -- it would be great if we got to decide when to destroy it

TaTo30 commented 1 month ago

Destroy source was added to solve some performance issues, but you are right that it could be aggressive and upredictable, I will add an optional prop like auto-destroy to let the developer decide. Meanwhile you could use v-show instead of v-if to make your project works.

ZachHandley commented 1 month ago

Thanks man I appreciate it