feat: add download attribute to download button

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>