0👍
By <iframe :src='getPDF'...
you should provide the URL to the PDF in the scr
, not the PDF content data.
I am not sure, if it is a good idea to store whole PDF in the Vuex store. You should better store the link to the PDF. Then it would be easy task.
But if you really want to do it this way, storing the PDF data in the Vues Store, then you will need to create an endpoint, which gives you your PDF file back.
I am not sure you can achieve this with Vue.js in frontend. It could be possibly done with Vue Router. But I would be slow and I suggest you to rethink the design of your dataflow.
- [Vuejs]-Trouble defining interface correctly TS2339: Property 'x' does not exist on type 'y' and with using a vue ref
- [Vuejs]-VueJS, Typescript and VSCode – "Relative import paths need explicit file extensions in EcmaScript imports…"
Source:stackexchange.com