vueuse / gesture

🕹 Vue Composables making your app interactive
https://gesture.vueuse.org
MIT License
353 stars 18 forks source link

Use in Nuxt3 #21

Open Rysakov1986 opened 1 year ago

Rysakov1986 commented 1 year ago

How to use the vueuse/gesture component in Nuxt3?

armenr commented 9 months ago

Yeah...wondering the same thing here! :)

happy-turtle commented 8 months ago

Add vueuse.gesture.ts to your plugins folder:

import { GesturePlugin } from '@vueuse/gesture'

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(GesturePlugin)
})

And then you can e.g. import { useDrag } from '@vueuse/gesture' in your components.

armenr commented 8 months ago

@happy-turtle - Thank you! I'm still learning the ropes with Nuxt, and the solution is so easy...so thanks for humoring this newb (me) :)

Last question:

Is this server-side friendly, or only client-side? :)

happy-turtle commented 8 months ago

@happy-turtle - Thank you! I'm still learning the ropes with Nuxt, and the solution is so easy...so thanks for humoring this newb (me) :)

Last question:

Is this server-side friendly, or only client-side? :)

No problem 😄 I am not sure, but we didn't run into problems using it with SSR.