Closed zhangyijie0214 closed 9 months ago
"I finally had time to study this, and I found that the 'onUnmounted' from the old page is triggered after the 'onMounted' of the new page, which causes the 'useRenderer' inside to pause the 'Loop'."
Could it be considered to change 'onUnmounted' to 'onBeforeUnmount'?🤔
I will solve it this way for now.😓
watch(()=> isActive.value,()=>{ if (!isActive.value) { resume() } })
Is there any progress on this issue?
Is there any progress on this issue?
Depends on which of the 3 issues inside the ticket you mean 😅, if it is the nuxt router issue is being handled here https://github.com/Tresjs/nuxt/issues/41
Hi @zhangyijie0214 since this ticket covers several bugs I would ask you to please create a ticket per issue:
Please edit the title and the description of the video to cover only the first question or close this one and open a new one.
Sure, I will close this issue and then try the latest version of Tres to see if the first problem still exists, and provide videos and reproduction code.
Describe the bug
"Hello, I have two questions:
1.In the custom rendering, it seems that Vue's unmount hooks, 'onUnmounted' and 'onBeforeUnmount', are not working. I'm using 'onLoop', and when I navigate to another page and then return, it creates a new 'onLoop' which runs alongside the previous one, including the 'onLoop' inside 'useFBO'. Currently, I can only unmount them by using 'onLoop.off' at the root canvas component. 2.I am using version 3.5.1, and I've noticed significant frame drops with touch and other events. I'm not sure if this has been optimized in newer versions. 3.I encounter a problem when using 'Tres' on two different pages. When I navigate from page 1 with 'tres' to page 2 with 'tres', nothing is displayed. However, if I go from page 1 with 'tres' to page 3 without 'tres', and then to page 2 with 'tres', this problem does not occur."
Reproduction
https://github.com/zhangyijie0214/nuxt-tres-test
Steps to reproduce
npm install npm run dev
System Info
No response
Used Package Manager
npm
Code of Conduct