mirror of
https://codeberg.org/HPCesia/AstralHalo.git
synced 2025-04-08 17:34:27 +08:00
fix: clean up TOC on component unmount
This commit is contained in:
parent
6a69383dcf
commit
8679d67a9f
@ -44,6 +44,13 @@ onMounted(() => {
|
||||
setup();
|
||||
document.addEventListener('astro:before-swap', cleanup);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (tocWrapper.value) tocWrapper.value.innerHTML = '';
|
||||
hasToc.value = false;
|
||||
window.removeEventListener('resize', handleResize);
|
||||
isWideScreen.value = false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Loading…
Reference in New Issue
Block a user