fix: uploadFile filelist

pull/2/head
xingyu 2023-01-16 16:53:13 +08:00
parent 5311f57977
commit 5450534a80
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
// //
const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => {
message.success('上传成功') message.success('上传成功')
const fileListNew = fileList.value
fileListNew.pop()
fileList.value = fileListNew
uploadList.value.push({ name: res.data, url: res.data }) uploadList.value.push({ name: res.data, url: res.data })
if (uploadList.value.length == uploadNumber.value) { if (uploadList.value.length == uploadNumber.value) {
fileList.value = fileList.value.concat(uploadList.value) fileList.value = fileList.value.concat(uploadList.value)