GSAP TweenMax

  • When I install gsap via

    npm install gsap 

    and import in index.vue via:

    import {TweenMax} from "gsap";

    I can reference TweenLite in a method:

    methods: {
        draw() {
   "#c1", 1, {opacity:0.5, rotation:45});

    But when I try to reference TweenMax, I get an error"#c1", 1, {opacity:0.5, rotation:45});
    Vue warn]: Error in event handler for "click": "TypeError: Cannot read property 'to' of undefined"

    Any idea why TweenMax is not resolved? It looks like all the modules are available under node_modules/gsap…


  • if I use:

    import TweenMax from 'gsap'

    it works… maybe a babel or webpack thing…

Log in to reply