feat(assets): clean up imgs
This commit is contained in:
@@ -1,6 +1,16 @@
|
|||||||
export const useImages = (...paths: string[]) =>
|
export const useImages = (...paths: string[]) => {
|
||||||
paths.map((path) => {
|
const images = paths.map((path) => {
|
||||||
const img = document.createElement("img");
|
const img = document.createElement("img");
|
||||||
img.src = path;
|
img.src = path;
|
||||||
return img;
|
return img;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
images.forEach((img) => {
|
||||||
|
img.src = "";
|
||||||
|
img.remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return images;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user