3.0.0 #220
@@ -62,13 +62,19 @@ const setupPage = async () => {
|
||||
|
||||
setupPage()
|
||||
|
||||
function downloadFile(row) {
|
||||
async function downloadFile(row) {
|
||||
const response = await useNuxtApp().$api.raw(row.url, {
|
||||
method: "GET",
|
||||
responseType: "blob"
|
||||
})
|
||||
const objectUrl = URL.createObjectURL(response._data as Blob)
|
||||
const a = document.createElement("a")
|
||||
a.href = row.url
|
||||
a.href = objectUrl
|
||||
a.download = row.file_path.split("/").pop()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
URL.revokeObjectURL(objectUrl)
|
||||
}
|
||||
|
||||
const showCreateExportModal = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user