feat: add download attribute to download button
All checks were successful
repod / xml (push) Successful in 12s
repod / php (push) Successful in 59s
repod / nodejs (push) Successful in 1m4s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-08-10 22:30:35 +02:00
parent e78e3b2565
commit 196bc23b1a

View File

@ -10,7 +10,7 @@
</template>
{{ title }}
</NcButton>
<NcButton v-if="url" :href="url" target="_blank">
<NcButton v-if="url" :download="filename" :href="url" target="_blank">
<template #icon>
<DownloadIcon :size="20" />
</template>
@ -70,6 +70,10 @@ export default {
episodeFileSize() {
return humanFileSize(this.size)
},
filename() {
const url = new URL(this.url)
return url.pathname.split('/').pop()
},
},
}
</script>