File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/components/UploadFile/src Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
100
100
// 文件上传成功
101
101
const handleFileSuccess: UploadProps [' onSuccess' ] = (res : any ): void => {
102
102
message .success (' 上传成功' )
103
- fileList .value .shift ()
103
+ // 删除自身
104
+ const index = fileList .value .findIndex ((item ) => item .response ?.data === res .data )
105
+ fileList .value .splice (index , 1 )
104
106
uploadList .value .push ({ name: res .data , url: res .data })
105
107
if (uploadList .value .length == uploadNumber .value ) {
106
108
fileList .value .push (... uploadList .value )
@@ -144,6 +146,7 @@ watch(
144
146
fileList .value .push (
145
147
... val .split (' ,' ).map ((url ) => ({ name: url .substring (url .lastIndexOf (' /' ) + 1 ), url }))
146
148
)
149
+ return
147
150
}
148
151
// 情况2:数组
149
152
fileList .value .push (
You can’t perform that action at this time.
0 commit comments