name of downloaded image is the same as the url in the exported json

This commit is contained in:
Moriz Wahl 2020-10-14 12:03:35 +02:00
parent a6f87a394a
commit 6ff02b41c8

View File

@ -48,12 +48,12 @@ export default {
document.body.appendChild(fileLink)
fileLink.click()
},
downloadImage({ url, title }) {
downloadImage({ url }) {
this.$axios.get(url, { responseType: 'blob' }).then((response) => {
const blob = new Blob([response.data], { type: 'application/pdf' })
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = title
link.download = url
link.click()
URL.revokeObjectURL(link.href)
})