获取后缀后返回相应类型进行操作
regex(e) {
var type = String(e.split('.').slice(-1))
if (type == undefined) {
return 'unlonwn'
}
if (type == 'jpg' || type == 'jpeg' || type == 'gif' || type == 'png' || type == 'bmp') {
return 'img'
} else if (type == 'xlsx' || type == 'docx' || type == 'html' || type == 'txt' || type == 'pptx') {
return type
} else {
return 'unknown'
}
},