Thank you for responding, despite I don't share any sandbox or codepen.
I had use data to store my gsap instance during mount, kill it and set data to null it during the beforeDestroy event.
data() {
return {
marqueeScrollTrigger: null,
}
},
methods: {
scrollAnim() {
this.marqueeScrollTrigger = gsap.to(this.$refs.inner, {
xPercent: -65,
scrollTrigger: {
trigger: this.$refs.marquee,
start: "top bottom",
end: "top top",
scrub: 0,
//markers: true,
//scroller: this.$el.parent,
}
})
},
},
mounted() {
this.scrollAnim();
},
beforeDestroy(){
this.marqueeScrollTrigger.kill()
//this.marqueeScrollTrigger.scrollTrigger.kill(true)
this.marqueeScrollTrigger = null
}
I also thought maybe there is a problem with a dependency, but I don't have much and I can't see which can cause the issue. I'm stuck and I really don't know why it works on sandbox or blank project but not in this.
"dependencies": {
"@vue/cli": "^4.5.12",
"core-js": "^3.6.5",
"embla-carousel": "^4.3.2",
"gsap": "file:gsap-bonus.tgz",
"normalize.css": "^8.0.1",
"vue": "^2.6.11",
"vue-router": "^3.2.0"
},
EDIT: I created a new project with those dependencies and devDependencies and it still works.
EDIT2: I also browse some topics with same problem with other framework (i.e React) and I tried the .refresh() method on mounted event and it doesn't work too.