mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
perf(theme): cleanup home hero effect when unmounted
This commit is contained in:
parent
192017b892
commit
802911c179
@ -448,6 +448,12 @@ onMounted(() => {
|
||||
|
||||
onUnmounted(() => {
|
||||
cleanup()
|
||||
renderer = null
|
||||
scene = null
|
||||
camera = null
|
||||
beamMesh = null
|
||||
directionalLight = null
|
||||
ambientLight = null
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -288,6 +288,7 @@ onUnmounted(() => {
|
||||
|
||||
if (resizeObserver) {
|
||||
resizeObserver.disconnect()
|
||||
resizeObserver = null
|
||||
}
|
||||
else {
|
||||
window.removeEventListener('resize', buildGrid)
|
||||
|
||||
@ -254,6 +254,8 @@ onUnmounted(() => {
|
||||
if (animationId) {
|
||||
cancelAnimationFrame(animationId)
|
||||
}
|
||||
gl = null
|
||||
program = null
|
||||
})
|
||||
|
||||
watch(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user