mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
parent
ebbe7e4079
commit
25649dbca5
@ -315,7 +315,7 @@ export function isArray(value: any): value is Array<any> {
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export function isFunction<T extends Function>(value: any): value is T {
|
||||
return getType(value) === 'function'
|
||||
return getType(value) === 'function' || getType(value) === 'asyncfunction'
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -124,7 +124,7 @@ export type UploadMethod = (
|
||||
onError: (res: UniApp.GeneralCallbackResult, file: UploadFileItem, formData: UploadFormData) => void
|
||||
onProgress: (res: UniApp.OnProgressUpdateResult, file: UploadFileItem) => void
|
||||
}
|
||||
) => void
|
||||
) => void | Promise<void>
|
||||
|
||||
export const uploadProps = {
|
||||
...baseProps,
|
||||
|
||||
@ -178,7 +178,7 @@ watch(
|
||||
watch(
|
||||
() => props.beforePreview,
|
||||
(fn) => {
|
||||
if (fn && !isFunction(fn) && getType(fn) !== 'asyncfunction') {
|
||||
if (fn && !isFunction(fn)) {
|
||||
console.error('The type of beforePreview must be Function')
|
||||
}
|
||||
},
|
||||
@ -191,7 +191,7 @@ watch(
|
||||
watch(
|
||||
() => props.onPreviewFail,
|
||||
(fn) => {
|
||||
if (fn && !isFunction(fn) && getType(fn) !== 'asyncfunction') {
|
||||
if (fn && !isFunction(fn)) {
|
||||
console.error('The type of onPreviewFail must be Function')
|
||||
}
|
||||
},
|
||||
@ -204,7 +204,7 @@ watch(
|
||||
watch(
|
||||
() => props.beforeRemove,
|
||||
(fn) => {
|
||||
if (fn && !isFunction(fn) && getType(fn) !== 'asyncfunction') {
|
||||
if (fn && !isFunction(fn)) {
|
||||
console.error('The type of beforeRemove must be Function')
|
||||
}
|
||||
},
|
||||
@ -217,7 +217,7 @@ watch(
|
||||
watch(
|
||||
() => props.beforeUpload,
|
||||
(fn) => {
|
||||
if (fn && !isFunction(fn) && getType(fn) !== 'asyncfunction') {
|
||||
if (fn && !isFunction(fn)) {
|
||||
console.error('The type of beforeUpload must be Function')
|
||||
}
|
||||
},
|
||||
@ -230,7 +230,7 @@ watch(
|
||||
watch(
|
||||
() => props.beforeChoose,
|
||||
(fn) => {
|
||||
if (fn && !isFunction(fn) && getType(fn) !== 'asyncfunction') {
|
||||
if (fn && !isFunction(fn)) {
|
||||
console.error('The type of beforeChoose must be Function')
|
||||
}
|
||||
},
|
||||
@ -243,7 +243,7 @@ watch(
|
||||
watch(
|
||||
() => props.buildFormData,
|
||||
(fn) => {
|
||||
if (fn && !isFunction(fn) && getType(fn) !== 'asyncfunction') {
|
||||
if (fn && !isFunction(fn)) {
|
||||
console.error('The type of buildFormData must be Function')
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user