Files
qingdao-employment-service/pages/chat/components/fileIcon.vue

53 lines
1.7 KiB
Vue
Raw Normal View History

2025-03-28 18:19:05 +08:00
<template>
2025-12-17 18:10:06 +08:00
<image v-if="type === 'application/pdf' || type === 'pdf'" :src="pdfIcon" class="file-icon" />
2025-03-28 18:19:05 +08:00
<image
v-else-if="
type === 'application/msword' ||
type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
"
:src="docIcon"
class="file-icon"
/>
<image
v-else-if="
type === 'application/vnd.ms-powerpoint' ||
2025-12-17 18:10:06 +08:00
type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation'||
type === 'ppt' ||
type === 'pptx'
2025-03-28 18:19:05 +08:00
"
:src="pptIcon"
class="file-icon"
/>
<image v-else-if="type === 'text/markdown'" :src="mdIcon" class="file-icon" />
<image v-else-if="type === 'text/plain'" :src="txtIcon" class="file-icon" />
<image v-else-if="type === 'text/html'" :src="htmlIcon" class="file-icon" />
<image
v-else-if="
type === 'application/vnd.ms-excel' ||
2025-12-17 18:10:06 +08:00
type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'||
type === 'xls' ||
type === 'xlsx'
2025-03-28 18:19:05 +08:00
"
:src="excelIcon"
class="file-icon"
/>
<image v-else :src="otherIcon" class="file-icon" />
</template>
<script setup>
import pdfIcon from '@/static/file/pdf.png';
import docIcon from '@/static/file/doc.png';
import pptIcon from '@/static/file/ppt.png';
import mdIcon from '@/static/file/md.png';
import txtIcon from '@/static/file/txt.png';
import htmlIcon from '@/static/file/html.png';
import excelIcon from '@/static/file/excel.png';
import otherIcon from '@/static/file/other.png';
const props = defineProps({
type: String,
});
const type = props.type;
</script>