From 69e76a4c2100bf45a2be49aae695a24c0d22c5ac Mon Sep 17 00:00:00 2001 From: nemo shen Date: Sun, 18 Feb 2024 23:04:54 +0800 Subject: [PATCH] fix: lint error --- packages/core/useUpload/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/useUpload/index.ts b/packages/core/useUpload/index.ts index a46e562..11d38d1 100644 --- a/packages/core/useUpload/index.ts +++ b/packages/core/useUpload/index.ts @@ -77,16 +77,16 @@ export const useUpload = (options: UseUploadOptions): UseUploadReturn => { } else { uploadIndexes = [index] } - files.value.forEach((file, index) => { + files.value.forEach((file: UseUploadFile, fileIndex) => { if (!uploadIndexes.includes(index)) return uploadFile({ url }, file.file).then((_result) => { - file.status = 'success' + files.value[fileIndex].status = 'success' }) }) } else { - files.value.forEach((file, index) => { + files.value.forEach((file, fileIndex) => { uploadFile({ url }, file.file).then((_result) => { - file.status = 'success' + files.value[fileIndex].status = 'success' }) }) } @@ -139,9 +139,9 @@ export const useUpload = (options: UseUploadOptions): UseUploadReturn => { removeIndexes = [index] } if ( - !removeIndexes.every((i) => { - return i < files.value.length - }) + !removeIndexes.every((i) => + i < files.value.length + ) ) { throw new Error('Index out of range.') }