hypernym-studio / nuxt-gsap

GSAP module for Nuxt.
MIT License
292 stars 12 forks source link

How would I do it with compositon api? #33

Closed BenKoenig closed 2 years ago

BenKoenig commented 2 years ago

Currently trying to do one of your examples with compositon api, but I can't figure out a way to make it work.

I'm keep getting the error $gsap is not defined

<script setup>
import { onMounted } from '@nuxtjs/composition-api';

onMounted(() => {
  setRotationOnLoad();
})

const setRotationOnClick = () => {
  $gsap.to('.title2', { rotation: 90, x: 100, duration: 2 })
}

const setRotationOnLoad = () => {
  $gsap.to('.title1', { rotation: 27, x: 100, duration: 1 })
}

</script>
ivodolenc commented 2 years ago

Hi, thanks for your interest.

At the moment, the module is not compatible with composition-api/nuxt3.

Please follow #24 for updates and more info. I will reopen it for others to see.