This commit is contained in:
syuilo 2025-09-23 19:21:19 +09:00
parent 4e0ffebcd4
commit 330f124bf6
2 changed files with 9 additions and 2 deletions

View File

@ -219,7 +219,7 @@ const uploader = useUploader({
});
onUnmounted(() => {
uploader.abortAll();
uploader.dispose();
});
uploader.events.on('itemUploaded', ctx => {

View File

@ -663,10 +663,16 @@ export function useUploader(options: {
item.preprocessedFile = markRaw(preprocessedFile);
}
onUnmounted(() => {
function dispose() {
for (const item of items.value) {
if (item.thumbnail != null) URL.revokeObjectURL(item.thumbnail);
}
abortAll();
}
onUnmounted(() => {
dispose();
});
return {
@ -674,6 +680,7 @@ export function useUploader(options: {
addFiles,
removeItem,
abortAll,
dispose,
upload,
getMenu,
uploading: computed(() => items.value.some(item => item.uploading)),