ichti-git / vue-draggabilly

Draggabilly plugin for Vue.js
6 stars 1 forks source link

Nuxt Integration #2

Open huxleydigitaluk opened 6 years ago

huxleydigitaluk commented 6 years ago

I know it's another thing but I'm trying to get the plugin to work with my NuxtJs site

I've used the usual approach that has worked with similar plugins but I don't have the depth of knowledge to crack this one. I am adding into my nuxt config file:

plugins: [ { src: '~/plugins/vue-draggabilly.js', ssr: false } ]

That file includes this code:

__

_import Vue from 'vue' import VueDraggabilly from 'vue-draggabilly'

Vue.use(VueDraggabilly)_ __

However, I get the following error and I'm not able to use:

vue-draggabilly.js:3 Uncaught ReferenceError: exports is not defined

This refers to this line in the plugin:

exports.install = function (Vue, options) { ....

Any help very greatly appreciated!

philwahle commented 5 years ago

I found a very helpful solution for this issue in the official nuxt repository

https://github.com/nuxt/nuxt.js/issues/2891

hope this helps.