<el-upload
class="upload-demo"
action="#"
multiple
:auto-upload="false"
list-type="picture-card"
:file-list="modelForm.fileList"
:show-file-list="false"
:limit="3"
:on-change="handleChange"
>
<el-button size="small" type="primary">点击上传文件</el-button>
</el-upload>
handleChange(file) {
let { uid } = file
const totalSize = this.modelForm.fileList.reduce(
(total, item) => total + item.size,
0
)
if (totalSize + size > 1024 * 1024 * 100) {
this.$message.warning('总文件大小不能超过100Mb')
const selectFileList = this.modelForm.fileList.filter(item => {
return item.uid != uid
})
this.modelForm.fileList = selectFileList
return
}
}