wip
This commit is contained in:
parent
4e0ffebcd4
commit
330f124bf6
|
@ -219,7 +219,7 @@ const uploader = useUploader({
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
uploader.abortAll();
|
uploader.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
uploader.events.on('itemUploaded', ctx => {
|
uploader.events.on('itemUploaded', ctx => {
|
||||||
|
|
|
@ -663,10 +663,16 @@ export function useUploader(options: {
|
||||||
item.preprocessedFile = markRaw(preprocessedFile);
|
item.preprocessedFile = markRaw(preprocessedFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
onUnmounted(() => {
|
function dispose() {
|
||||||
for (const item of items.value) {
|
for (const item of items.value) {
|
||||||
if (item.thumbnail != null) URL.revokeObjectURL(item.thumbnail);
|
if (item.thumbnail != null) URL.revokeObjectURL(item.thumbnail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abortAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -674,6 +680,7 @@ export function useUploader(options: {
|
||||||
addFiles,
|
addFiles,
|
||||||
removeItem,
|
removeItem,
|
||||||
abortAll,
|
abortAll,
|
||||||
|
dispose,
|
||||||
upload,
|
upload,
|
||||||
getMenu,
|
getMenu,
|
||||||
uploading: computed(() => items.value.some(item => item.uploading)),
|
uploading: computed(() => items.value.some(item => item.uploading)),
|
||||||
|
|
Loading…
Reference in New Issue