14 lines
400 B
Vue
14 lines
400 B
Vue
|
|
<script setup lang="ts">
|
||
|
|
const props = defineProps<{
|
||
|
|
dataResource?: string,
|
||
|
|
dataTitle?: string,
|
||
|
|
}>()
|
||
|
|
|
||
|
|
const resource = computed(() => props.dataResource ?? '')
|
||
|
|
const title = computed(() => props.dataTitle ?? '')
|
||
|
|
const fileName = computed(() => `${title.value}.${resource.value.split('.').pop()}`)
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<a :href="resource" :download="fileName">{{fileName}}</a>
|
||
|
|
</template>
|