Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/assets/vue/components/documents/ResourceFileLink.vue

39 lines
693 B

<template>
<a
:data-type="getDataType"
:href="resource.contentUrl"
data-fancybox="gallery"
>
<ResourceIcon :resource-data="resource" />
{{ resource.title }}
</a>
</template>
<script>
import ResourceIcon from "./ResourceIcon.vue"
export default {
name: "ResourceFileLink",
components: {
ResourceIcon,
},
props: {
resource: {
type: Object,
required: true,
},
},
computed: {
getDataType() {
if (this.resource.resourceNode.firstResourceFile.image) {
return "image"
}
if (this.resource.resourceNode.firstResourceFile.video) {
return "video"
}
return "iframe"
},
},
}
</script>