二次封装el-upload,可单个、多个图片上传
<template>
<div class="uploadImg">
<div class="imgList_box" :class="{ maxHidden: hideUploadImg }">
<div
v-for="(item, index) in imgfileList"
:key="item.imageUrl + index"
class="imgItem"
:style="{ width: width + 'px', height: height + 'px' }"
>
<el-image
:z-index="3000"
:src="baseUrl + item.imageUrl"
:preview-src-list="[baseUrl + item.imageUrl]"
></el-image>
<div class="shadow" @click="handleRemove(index)">
<i class="el-icon-delete"></i>
</div>
</div>
<el-upload
:action="uploadImgUrl"
list-type="picture-card"
:show-file-list="false"
:headers="importHeaders"
:limit="limit"
:multiple="isMultiple"
:file-list="fileList"
:before-upload="handleBeforeUpload"
:on-success="handleSuccess"
:on-exceed="handleExceedLength"
:on-progress="uploadImgProcess"
:style="{ width: width + 'px', height: height + 'px' }"
ref="uploadImgRef"
class="uploadImgBox"
>
<el-progress
v-if="showProgress"
type="circle"
:percentage="uploadPercent"
></el-progress>
<i v-else class="el-icon-plus avatar-uploader-icon">