Vue/HTML/JS how to download a file to browser using the download tag
You can fetch the file as a blob and provide it the same way, there will be no request that leads into CORS issues. Template <a :href=”item.url” v-text=”item.label” @click.prevent=”downloadItem(item)” /> Vue methods: { downloadItem ({ url, label }) { Axios.get(url, { responseType: ‘blob’ }) .then(response => { const blob = new Blob([response.data], { type: ‘application/pdf’ … Read more