Jump to content
Search Community

andelko21

Members
  • Posts

    5
  • Joined

  • Last visited

Community Answers

  1. andelko21's post in GSAP ScrollTrigger with Vue and Vue router was marked as the answer   
    I solved my issues.
    I have to use :
     
    <router-view v-slot="{ Component }"> <keep-alive> <component :is="Component" /> </keep-alive> </router-view> inside my root component and then when first time component is call onmounted hook I used function to init scrollTrigger, and with <keep-alive> i got two new hooks activated  and deactivated  where I could toggle between .enable() and .disable() ScrollTrigger instance. Without any problems.
     I still doesn't have conclusion why this happened in old version, here is picture of call stack and closure when .enable() is called, you can see that ref on my element "logo" is null but it should have value in due of hook mounted where I did call .enabled().
    Ps. I think I get this
    This happened because in my old version after the componet being destroyed all reactive that was deleted to. So it was the reason of null reference at .enable() and why Gsap couldn't be able do trigger after changing routes, simply it had old ref for not existing element.
     

  2. andelko21's post in GSAP stuttering when using stagger was marked as the answer   
    You are using transition all in your css *
×
×
  • Create New...