与GSAP ScrollMagic - 这些依赖关系并没有在animation.gsap.js发现

问题描述 投票:0回答:1

我想不过使用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);
}

没有人有任何想法,为什么这可能无法正常工作?

先感谢您!

javascript webpack nuxt.js gsap scrollmagic
1个回答
0
投票

我想你要导入GSAP错误。尝试:

import {TweenMax, Power2, TimelineLite, TimelineMax, TweenLite} from "gsap/TweenMax"

有关进一步信息NPM文档:https://www.npmjs.com/package/gsap#npm

© www.soinside.com 2019 - 2024. All rights reserved.