BramHoningh / vue-body-scroll-lock

A Vue directive to lock the body scroll without stopping the target element from scrolling.
30 stars 11 forks source link

Nuxt Instructions #27

Open lmuzquiz opened 3 years ago

lmuzquiz commented 3 years ago

Can you add instructions for Nuxt? I tried to make it work for like 30 mins but couldn't

This was on my plugins folder:

Screen Shot 2021-01-16 at 22 55 10

I also registered as a client plugin within nuxt config:

Screen Shot 2021-01-16 at 22 57 40
massmediagroup-89 commented 2 years ago
 plugins: [
 { src:'~plugins/is-allow-body-scroll.js', mode: 'client' },
]

and on the is-allow-body-scroll.js

import Vue from 'vue'
import VBodyScrollLock from 'v-body-scroll-lock'

Vue.use(VBodyScrollLock)

This works well for me