mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2026-01-13 20:57:09 +08:00
refactor(system/file): 重构文件管理相关代码
This commit is contained in:
@@ -15,13 +15,17 @@ const props = withDefaults(defineProps<Props>(), {})
|
||||
|
||||
// 是否是图片类型文件
|
||||
const isImage = computed(() => {
|
||||
const extension = props.data.extension.toLowerCase()
|
||||
const extension = props.data.extension?.toLowerCase()
|
||||
return ImageTypes.includes(extension)
|
||||
})
|
||||
|
||||
// 获取文件图标,如果是图片就显示图片
|
||||
const getFileImg = computed<string>(() => {
|
||||
const extension = props.data.extension.toLowerCase()
|
||||
// 文件夹
|
||||
if (props.data.type === 0) {
|
||||
return FileIcon.dir
|
||||
}
|
||||
const extension = props.data.extension?.toLowerCase()
|
||||
if (ImageTypes.includes(extension)) {
|
||||
return props.data.url || ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user