Browse Source
fix: 1.修正ImageUpload直接使用时无法正常回传value 2.修正ImageUpload无法正常初始化第一次传值 (#3704)
pull/3714/head
1455668754
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
0 deletions
-
src/components/Upload/src/components/ImageUpload.vue
|
|
@ -92,6 +92,10 @@ |
|
|
}) as UploadProps['fileList']; |
|
|
}) as UploadProps['fileList']; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
immediate: true, |
|
|
|
|
|
deep: true, |
|
|
|
|
|
}, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
function getBase64<T extends string | ArrayBuffer | null>(file: File) { |
|
|
function getBase64<T extends string | ArrayBuffer | null>(file: File) { |
|
|
@ -121,6 +125,7 @@ |
|
|
index !== -1 && fileList.value.splice(index, 1); |
|
|
index !== -1 && fileList.value.splice(index, 1); |
|
|
const value = getValue(); |
|
|
const value = getValue(); |
|
|
isInnerOperate.value = true; |
|
|
isInnerOperate.value = true; |
|
|
|
|
|
emit('update:value', value); |
|
|
emit('change', value); |
|
|
emit('change', value); |
|
|
emit('delete', file); |
|
|
emit('delete', file); |
|
|
} |
|
|
} |
|
|
@ -168,6 +173,7 @@ |
|
|
info.onSuccess!(res.data); |
|
|
info.onSuccess!(res.data); |
|
|
const value = getValue(); |
|
|
const value = getValue(); |
|
|
isInnerOperate.value = true; |
|
|
isInnerOperate.value = true; |
|
|
|
|
|
emit('update:value', value); |
|
|
emit('change', value); |
|
|
emit('change', value); |
|
|
} catch (e: any) { |
|
|
} catch (e: any) { |
|
|
console.log(e); |
|
|
console.log(e); |
|
|
|