如何上传文件覆盖旧文件?
1、可以再其on-success挂载的函数执行判断fileList长度的方式来判断
handleSuccess (response, file, fileList) {
if (fileList.length > 1) {
fileList.splice(0, 1)
}
}
2、也可以在接口的 then成功回调里调用
if (fileList.length > 1) {
fileList.splice(0, 1)
}
上传提交文件不能为空校验?
handleChange(row,file,fileList){
if(file.size == 0){
this.$message('上传文件不能为空')
}
}