使用 :on-change=“handleChange” 来实现文件的覆盖
<el-upload
class="upload-demo"
action=""
:http-request="uploadPicture"
:on-preview="handlePreview"
:on-remove="handleRemoves"
:before-remove="beforeRemoves"
:on-error="imgUploadError"
:file-list="pictureList"
:on-change="handleChange"
list-type="xls"
:limit="2"
accept=".xlsx">
<el-button size="small" type="success" :loading="notUpload" style="width:220px;">点击上传</el-button>
</el-upload>
handleChange(file, fileList) {
if (fileList.length > 1) {
fileList[0] = fileList[1]
fileList.splice(1, 1);
}
},