Open MDALIMULALRAZY opened 3 years ago
Same problem here
TypeError: vue_scrollmagic__WEBPACK_IMPORTED_MODULE_1___default.a.Controller is not a constructor
at VueComponent.mounted (Home.vue?76f2:44)
at invokeWithErrorHandling (vue.runtime.esm.js?5593:1854)
at callHook (vue.runtime.esm.js?5593:4219)
at Object.insert (vue.runtime.esm.js?5593:3139)
at invokeInsertHook (vue.runtime.esm.js?5593:6346)
at VueComponent.patch [as __patch__] (vue.runtime.esm.js?5593:6565)
at VueComponent.Vue._update (vue.runtime.esm.js?5593:3948)
at VueComponent.updateComponent (vue.runtime.esm.js?5593:4066)
at Watcher.get (vue.runtime.esm.js?5593:4479)
at Watcher.run (vue.runtime.esm.js?5593:4554)```
I am facing the same issue.
actually I've found a solution @anku598 and @MDALIMULALRAZY, the documentation isn't cleary about it but you have to change a little bit the way you're calling de methods like this :
import $scrollmagic from 'vue-scrollmagic'; ( alredy is your controller)
Vue.use($scrollmagic);
mounted() {
const scene = this.$scrollmagic.scene({
duration: 9000,
triggerElement: this.$refs.home,
triggerHook: 0,
})
.addIndicators()
.setPin(this.$refs.home);
this.$scrollmagic.addScene(scene); ( here you can use it )
scene.on('update', (e) => {
this.scrollpos = e.scrollPos / 1000;
});
this.checkScroll();
},
beforeDestroy() {
this.$scrollmagic.destroy();
this.scene = null;
this.scenes = null;
},
// this.$scrollmagic.Controller is not a constructor