mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
refactor(upload): simplify codes
This commit is contained in:
parent
8a4d63a5c6
commit
ea3744dc1b
@ -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<FuncOrRecordOrUndef>,
|
||||
headers: [Object, Function] as PropType<FuncOrRecordOrUndef>,
|
||||
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
|
||||
}
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user