From 4d80fa6016226fd8ade7284886e8a22cfc3757f0 Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 16 Jun 2023 17:57:47 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=96=87=E4=BB=B6=E5=A4=B9=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FancyTree/index.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/FancyTree/index.vue b/src/components/FancyTree/index.vue index 29a62f5..a294b3e 100644 --- a/src/components/FancyTree/index.vue +++ b/src/components/FancyTree/index.vue @@ -458,18 +458,20 @@ if(file.isFolder){ return 'folder' } - if(file.contentType.indexOf('video') > -1){ - return 'video' - } - if(file.contentType.startsWith('image')){ - return 'image' - } - if(file.contentType.indexOf('audio') > -1){ - return 'audio' + if (file.contentType) { + if(file.contentType.indexOf('video') > -1){ + return 'video' + } + if(file.contentType.startsWith('image')){ + return 'image' + } + if(file.contentType.indexOf('audio') > -1){ + return 'audio' + } } let suffix = file.suffix; if(!suffix && file.name){ - suffix = file.name.substring(file.name.lastIndexOf('.') + 1); + suffix = file.name.substring(file.name.lastIndexOf('.') + 1) } if(iconClass.has(suffix)){ return iconClass.get(suffix)