Skip to content

Commit

Permalink
fix(components): [upload] add uid for file handleStart (#9876)
Browse files Browse the repository at this point in the history
  • Loading branch information
init-qy committed Oct 28, 2022
1 parent 43b5ea1 commit 48f837b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/components/upload/src/use-handlers.ts
@@ -1,4 +1,5 @@
import { watch } from 'vue'
import { isNil } from 'lodash-unified'
import { useVModel } from '@vueuse/core'
import { debugWarn, throwError } from '@element-plus/utils'
import { genFileId } from './upload'
Expand Down Expand Up @@ -84,6 +85,7 @@ export const useHandlers = (
}

const handleStart: UploadContentProps['onStart'] = (file) => {
if (isNil(file.uid)) file.uid = genFileId()
const uploadFile: UploadFile = {
name: file.name,
percentage: 0,
Expand Down

0 comments on commit 48f837b

Please sign in to comment.