Download Vue Js

Posted on  by admin
1111 bronze badges. You can fetch the file as a blob and provide it the same way, there will be no request that leads into CORS issues. Notes: I used Axios for my example but that's not a requirement, the blob's mime type is hardwired for the sake of simplicity. 22 gold badges2121 silver badges2323 bronze badges. 2323 bronze badges. If you want the browser to handle the download instead of handling the download in JavaScript you need to use This gives a better user experience IMO but gets tricky to set up when trying to access authorization-protected content. To do this you need to store the authorization in cookies instead of relying on storing the authorization header in the browser's local storage. This will require configuring your server & client to authenticate this way. To do this client side make sure axios knows to store credentials:. To do this server side depends on which server you use. I'm using Laravel and Vue.With In Laravel route. In the controller method for download, I return -> responsible instance. 88 gold badges6666 silver badges9090 bronze badges. 9090 bronze badges. In addition to the accepted answer, files can be easily downloaded through the file-saver package.
11 gold badge2828 silver badges2525 bronze badges. 2525 bronze badges. Vue.js does not support IE8 and below, because Vue.js uses ECMAScript 5 features that are un-shimmable in IE8.
runs on:
Windows / Linux / Mac OS / BSD / Solaris
main category:
coding language:
visit homepage