From ea3744dc1b706a9c8327821e0a7233e8893e3a7e Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Tue, 2 Feb 2021 23:38:37 +0800 Subject: [PATCH] refactor(upload): simplify codes --- src/upload/src/Upload.tsx | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/upload/src/Upload.tsx b/src/upload/src/Upload.tsx index 15abfd114..01351671c 100644 --- a/src/upload/src/Upload.tsx +++ b/src/upload/src/Upload.tsx @@ -176,14 +176,8 @@ export default defineComponent({ type: String, default: 'file' }, - accept: { - type: String, - default: undefined - }, - action: { - type: String, - default: undefined - }, + accept: String, + action: String, // to be impl // directory: { // type: Boolean, @@ -197,14 +191,8 @@ export default defineComponent({ type: Boolean, default: false }, - data: { - type: [Object, Function], - default: undefined - }, - headers: { - type: [Object, Function], - default: undefined - }, + data: [Object, Function] as PropType, + headers: [Object, Function] as PropType, withCredentials: { type: Boolean, default: false @@ -332,11 +320,11 @@ export default defineComponent({ file, formData, { - method: method, - action: action, - withCredentials: withCredentials, - headers: headers, - data: data + method, + action, + withCredentials, + headers, + data } ) }