From b09818195d50eaa8ebe14adec6f2c8ee7dcba22b Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Thu, 1 Jul 2021 01:03:45 +0800 Subject: [PATCH] chore: fix lint --- src/upload/demos/enUS/controlled.demo.md | 2 +- src/upload/demos/zhCN/controlled.demo.md | 2 +- src/upload/src/Upload.tsx | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/upload/demos/enUS/controlled.demo.md b/src/upload/demos/enUS/controlled.demo.md index f202ee22c..12efb8e25 100644 --- a/src/upload/demos/enUS/controlled.demo.md +++ b/src/upload/demos/enUS/controlled.demo.md @@ -71,7 +71,7 @@ export default defineComponent({ } }, handleFileListChange (value) { - message.info("Yes, file-list changed.") + message.info('Yes, file-list changed.') } } } diff --git a/src/upload/demos/zhCN/controlled.demo.md b/src/upload/demos/zhCN/controlled.demo.md index a20772321..39ed105ed 100644 --- a/src/upload/demos/zhCN/controlled.demo.md +++ b/src/upload/demos/zhCN/controlled.demo.md @@ -68,7 +68,7 @@ export default defineComponent({ } }, handleFileListChange (value) { - message.info("是的,file-list 的值变了") + message.info('是的,file-list 的值变了') } } } diff --git a/src/upload/src/Upload.tsx b/src/upload/src/Upload.tsx index 85137ac00..fca8b8971 100644 --- a/src/upload/src/Upload.tsx +++ b/src/upload/src/Upload.tsx @@ -327,21 +327,23 @@ export default defineComponent({ file: file, url: null } - if (!onBeforeUpload || await onBeforeUpload({ + if ( + !onBeforeUpload || + (await onBeforeUpload({ file: fileInfo, fileList: mergedFileListRef.value - }) !== false) { + })) !== false + ) { doChange(fileInfo, e, { append: true }) } }) - ) - .then(() => { - if (props.defaultUpload) { - submit() - } - }) + ).then(() => { + if (props.defaultUpload) { + submit() + } + }) } function submit (fileId?: string): void { const {