How to download a file stored in local directory using vue js?

I have user manual PDF file. I want to simply download that file over by a button click. Please help me to get the best way for doing that .I don’t wanna hit server . Is it possible then how ?

Hi. You could store it in a base64 inside your html like this:

http://jsfiddle.net/johandalabacka/qdnc4sbz/

Just keep in mind possible browser size limits on Data URIs and also the fact that doing this will bloat your js - so best to chunk it so your users aren’t constantly downloading a full pdf anytime your change a line of code in your app.

2 Likes