perf(theme): cleanup home hero effect when unmounted

This commit is contained in:
pengzhanbo 2025-10-31 18:08:15 +08:00
parent 192017b892
commit 802911c179
3 changed files with 9 additions and 0 deletions

View File

@ -448,6 +448,12 @@ onMounted(() => {
onUnmounted(() => {
cleanup()
renderer = null
scene = null
camera = null
beamMesh = null
directionalLight = null
ambientLight = null
})
</script>

View File

@ -288,6 +288,7 @@ onUnmounted(() => {
if (resizeObserver) {
resizeObserver.disconnect()
resizeObserver = null
}
else {
window.removeEventListener('resize', buildGrid)

View File

@ -254,6 +254,8 @@ onUnmounted(() => {
if (animationId) {
cancelAnimationFrame(animationId)
}
gl = null
program = null
})
watch(