Skip to content

Commit 673ac26

Browse files
committed
fix(vue): re-init gsap context inside separated directive
1 parent 4af36d3 commit 673ac26

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/runtime/nuxt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default defineNuxtPlugin((nuxtApp) => {
99
'gsap',
1010
vGsapDirective(
1111
'nuxt',
12-
useRuntimeConfig().public.vgsap,
13-
gsap.context(() => {}),
12+
useRuntimeConfig().public.vgsap ?? {},
13+
null,
1414
resizeListener,
1515
),
1616
)

src/runtime/plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const vGsapDirective = (
5050

5151
beforeMount(el, binding, vnode) {
5252
if (appType == 'vue') el.dataset.gsapId = uuidv4()
53+
if (!gsapContext) gsapContext = gsap.context(() => {})
5354

5455
binding = loadPreset(binding, configOptions)
5556

0 commit comments

Comments
 (0)