Jump to content
GreenSock

IvanChen

GSAP3+Vue-cli4

Moderator Tag

Recommended Posts

I install gsap-bonus.tgz with Vue-cli 4 and follow the tutorial. Then setting up as bellow.

 

//main.js

import gsap from "gsap";

//Home.vue

let obj = document.getElementById("test");
      gsap.from(obj,1,{opacity:0.1,y:30})

 

I used gsap in my component but got "ReferenceError: gsap is not defined".

Link to comment
Share on other sites

gsap is not global when using modules. You need to import gsap inside every file.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×