Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

zulfarrakk

Members
  • Posts

    2
  • Joined

  • Last visited

zulfarrakk's Achievements

2

Reputation

  1. I found out how to solve it: data () { return { draggableItem: [] } }, methods: { loadList(){ setTimeout(() => { //gsap.registerPlugin(Draggable, InertiaPlugin); this.draggableItem = Draggable.create('#wrapper__drag', { type:'x', bounds: '.drag__inner-wrapper', autoScroll: 1, inertia: true }); }, 1000); } }, mounted () { gsap.registerPlugin(Draggable, InertiaPlugin); this.$root.$on ('myEvent', () => { setTimeout(() => { this.loadList() }, 1500); }); }, beforeDestroy() { this.draggableItem[0].kill(); } Hope this can help someone
  2. Hello, I'm having an issue trying to destroy a Draggable instance on beforeDestroy and I always get the message that Draggable in not defined and so I can't kill the instance. methods: { loadList(){ setTimeout(() => { //gsap.registerPlugin(Draggable, InertiaPlugin); Draggable.create('#wrapper__drag', { type:'x', bounds: '.drag__inner-wrapper', autoScroll: 1, inertia: true }); }, 1000); } }, mounted () { gsap.registerPlugin(Draggable, InertiaPlugin); this.$root.$on ('myEvent', () => { setTimeout(() => { this.loadList() }, 1500); }); }, beforeDestroy() { Draggable.get('#wrapper__drag').kill(); } In console I get: VM15175:1 Uncaught ReferenceError: Draggable is not defined Please help me.
×