这里写自定义目录标题
element-ui的图片上传类型全
你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。
类型
const isList =["image/jpeg","image/png","text/plain","application/x-zip-compressed","application/msword","application/vnd.ms-excel","application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
使用
if (isList.indexOf(file.type) == -1){
this.$message.error('上传头像图片只能是 .jpg,.png,.txt,.zip,.doc,.xls,.pdf,.docx,.xlsx 格式!');
return false
}