0
votes

Trying to get the Dragabilly Vue plugin to work with my Nuxt app: https://www.npmjs.com/package/vue-draggabilly

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) { ....

It is a usual vuew plugin package, but I'm not sure how to get it to work with nuxt. Any help very greatly appreciated!

1

1 Answers

1
votes

I see a warning:

warning in ./plugins/vue-draggabilly.js

4:8-22 "export 'default' (imported as 'VueDraggabilly') was not found in 'vue-draggabilly'

I don't know the best answer, but this seems to work:

import Vue from 'vue'
import * as VueDraggabilly from 'vue-draggabilly'

Vue.use(VueDraggabilly)