pirony / ks-vue-scrollmagic

Vue plugin that makes using Scrollmagic with Vue a walk in the park
MIT License
45 stars 9 forks source link

vm is not defined #2

Closed jesperlandberg closed 7 years ago

jesperlandberg commented 7 years ago

EDIT: Changed vm to this=)

However now I have another issue. It seems I can't reference this.$gsap.TweenMax.to.... However if i import TweenMax from 'gsap' in the component it works, and just use TweenMax.to....

pirony commented 7 years ago

Hi @jesperlandberg ,

It should work: fiddle

Which version are you using? (npm or github). Can you share your code plz? thanks

pirony commented 7 years ago

Closing issue due to inactivity. Feel free to open a new one if needed. Btw, avoid requiring gsap as it will include it twice in your final bundle... use this.$gsap.TweenMax instead

rwfresh commented 5 years ago

First off thanks for making this. I'm having the same problem. I am using nuxt, I have included ks-vue-scrollmagic, I have created the plugin file in the plugin folder. There is a typo btw in the project page instructions. src: in nuxt.config.js should be '~/plugins/ksvuefp'
and not '~/plugins/ksvuescrollmagic'

In my index page this (must use this, not vm for nuxt "cli" created projects) the reference to this.$gsap is empty. Not sure where to go from here. Hope we can re-open this one.