|
|
|
@ -20,7 +20,7 @@ |
|
|
|
drag |
|
|
|
action="javascript:void(0);" ref="uploadFile" :limit="1" |
|
|
|
:before-upload="beforeUploadHandle" :on-change="onChange" |
|
|
|
accept=".jpg,.pdf,.PDF" :auto-upload="false" |
|
|
|
accept="*" :auto-upload="false" |
|
|
|
style="text-align: left;"> |
|
|
|
<i class="el-icon-upload"></i> |
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
|
|
|
@ -86,11 +86,11 @@ export default { |
|
|
|
|
|
|
|
// 上传之前 |
|
|
|
beforeUploadHandle(file) { |
|
|
|
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
|
|
|
this.$message.error('只支持图片和PDF文档!') |
|
|
|
return false |
|
|
|
} |
|
|
|
this.num++ |
|
|
|
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
|
|
|
// this.$message.error('只支持图片和PDF文档!') |
|
|
|
// return false |
|
|
|
// } |
|
|
|
// this.num++ |
|
|
|
}, |
|
|
|
|
|
|
|
/*选择上传文件时*/ |
|
|
|
|