donmbelembe / vue-dragscroll

A vue directive to make a scrollable element scroll by draging to the scroll direction
https://vue-dragscroll.clebinfosys.com/
MIT License
257 stars 32 forks source link

Not usable on Nuxt - 'window is not defined' #58

Closed PayteR closed 4 years ago

PayteR commented 4 years ago

Hi, this plugin is not usable on Nuxt anymore due to fact, that page is generated on server first (Node.js) and there is no window object. Please don't call window object, or check if it's not undefined first. Thx.

image

alijaya commented 4 years ago

I have the same issue ._. I'm using gridsome though

donmbelembe commented 4 years ago

I'm using the window object multiple places, this plugin is intended to be rendered on client client, please set SSR to false on your nuxt.config.js file

plugins: [ { src: '~/plugins/vue-dragscroll', ssr: false } ]