feat(assets): clean up imgs

This commit is contained in:
2025-11-18 21:18:40 +01:00
parent 694b64f0dd
commit ca6e4e6a5e

View File

@@ -1,6 +1,16 @@
export const useImages = (...paths: string[]) =>
paths.map((path) => {
export const useImages = (...paths: string[]) => {
const images = paths.map((path) => {
const img = document.createElement("img");
img.src = path;
return img;
});
onBeforeUnmount(() => {
images.forEach((img) => {
img.src = "";
img.remove();
});
});
return images;
};