element UI upload组件上传附件格式限制

<el-upload
   :action="uploadUrl"
   ref="upload"
   :multiple="false"
   :on-change="fileChange"
   :before-upload="beforeUpload"
   :on-success="handleAvatarSuccess"
   :on-preview="file_click"
   class="upload-demo"
   list-type="text"
   accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
   :file-list="uploadForm.personFileList"
   :auto-upload="false">
   <el-button size="small" type="primary">选择文件</el-button>
        <div slot="tip" class="el-upload__tip"><i class="el-icon-warning" style="color:red;margin-right:5px"></i>单个文件不超过5MB</div>
 </el-upload>

accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
//accept支持上传文件格式

 

posted @ 2020-07-15 11:20  叶子0321~  阅读(795)  评论(0编辑  收藏  举报