Jump to content
Search Community

GSAP3+Vue-cli4

IvanChen
Moderator Tag

Recommended Posts

Posted

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".

Posted

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

  • Like 3
Posted

Thanks for rapid help. It works!

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.
×
×
  • Create New...