我想不过使用GSAP和ScrollMagic在我的项目之一,当我尝试和需要animation.gsap.js
我的编译器不断抛出下面的错误;
These dependencies were not found: friendly-errors 14:54:44
friendly-errors 14:54:44
* TimelineMax in ./node_modules/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js friendly-errors 14:54:44
* TweenMax in ./node_modules/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js
我使用的内部NuxtJS插件,要求这些插件。 GSAP本身工作正常,ScrollMagic单独工作正常。然而,当涉及到使用GSAP插件滚动魔术似乎并不奏效。
Plugin.js
import Vue from 'vue'
import Navigation from '../components/Navigation.vue'
import {TweenMax, Power2, TimelineLite, TimelineMax, TweenLite} from "gsap"
import ScrollMagic from 'scrollmagic';
require("scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap");
export default () => {
Vue.component('navigation', Navigation);
}
没有人有任何想法,为什么这可能无法正常工作?
先感谢您!
我想你要导入GSAP错误。尝试:
import {TweenMax, Power2, TimelineLite, TimelineMax, TweenLite} from "gsap/TweenMax"
有关进一步信息NPM文档:https://www.npmjs.com/package/gsap#npm