Closed ivodolenc closed 1 year ago
Adds custom composables.
boolean
true
Provides the main $gsap core with plugins globally.
$gsap
// nuxt.config.ts { gsap: { provide: true } }
Available globally
const { $gsap } = useNuxtApp() $gsap.to('.class', { rotation: 3, x: 100, duration: 1 })
undefined
Specifies custom composables.
If enabled, allows the use of custom composables.
// nuxt.config.ts { gsap: { composables: true } }
When using only composables, it is recommended to disable global import.
// nuxt.config.ts { gsap: { composables: true provide: false // global import } }
Provides the main gsap core as custom composable.
gsap
It is automatically enabled with the composables: true option.
composables: true
<template> <h1 class="title">Nuxt Gsap Module</h1> </template> <script setup lang="ts"> useGsap.to('.title', { rotation: 3, x: 100, duration: 1 }) </script>
// Explicit import (optional) import { useGsap } from '#gsap'
Specifies the auto-import feature.
auto-import
If enabled, the composables will be available globally so there is no need to import them manually.
Since this is an opinionated feature, you can disable global auto-import and use explicit import only where you need it.
[!NOTE]\ Works only if the option composables: true is enabled.
// nuxt.config.ts { gsap: { autoImport: false } }
Type of Change
Request Description
Adds custom composables.
Provide
boolean
true
Provides the main
$gsap
core with plugins globally.Available globally
Composables
boolean
undefined
Specifies custom composables.
If enabled, allows the use of custom composables.
When using only composables, it is recommended to disable global import.
useGsap
Provides the main
gsap
core as custom composable.It is automatically enabled with the
composables: true
option.Auto Import
boolean
true
Specifies the
auto-import
feature.If enabled, the composables will be available globally so there is no need to import them manually.
Since this is an opinionated feature, you can disable global
auto-import
and use explicit import only where you need it.