文件名重复问题修复
parent
c67f6773b9
commit
1d3b718740
|
@ -66,6 +66,17 @@ export default {
|
|||
this.$refs.uploadFile.clearFiles()
|
||||
return false
|
||||
}
|
||||
let nameNumber = 0
|
||||
for (let j = 0; j < fileList.length; j++) {
|
||||
if (fileList[j].name === file.name) {
|
||||
nameNumber = nameNumber + 1
|
||||
}
|
||||
}
|
||||
if (nameNumber > 1) {
|
||||
this.$message.error('文件名重复,请重新选择!')
|
||||
this.$refs.uploadFile.handleRemove(file)
|
||||
return false
|
||||
}
|
||||
this.$emit('update:fileList', fileList)
|
||||
},
|
||||
onRemove(file, fileList) {
|
||||
|
|
Loading…
Reference in New Issue