Merge pull request #151 from tfsantos05/main

Fixed Particles Background racing issue by changing "onMounted"
This commit is contained in:
David
2026-04-22 13:49:00 +03:00
committed by GitHub
@@ -3,7 +3,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUnmounted, watch, useTemplateRef } from 'vue'; import { ref, onMounted, onUnmounted, watch, useTemplateRef, nextTick } from 'vue';
import { Renderer, Camera, Geometry, Program, Mesh } from 'ogl'; import { Renderer, Camera, Geometry, Program, Mesh } from 'ogl';
interface ParticlesProps { interface ParticlesProps {
@@ -296,8 +296,10 @@ const cleanup = () => {
program = null; program = null;
}; };
onMounted(() => { // CHANGED onMounted
initParticles(); onMounted(async () => {
await nextTick(); // wait for Vue to flush its DOM updates first
initParticles();
}); });
onUnmounted(() => { onUnmounted(() => {