Home

Issue: 1313

Failed to resolve directive: dragula

[issue link]

I’m trying to use Vue2-dragula in Nuxt but keep getting this message in my console Failed to resolve directive: dragula (and my elements are not draggable)

I’ve added the following to my nuxt.config.js:

  plugins: [
    { src: '~plugins/vue2-dragula', ssr: false }
  ]

With the following setup in plugins/vue2-dragula.js:

import Vue from 'vue';
import Vue2Dragula from 'vue2-dragula';

Vue.use(Vue2Dragula, {
  logging: {
    service: true
  }
});

Trying to get the following test setup functional:

<template>
<div>
<h3>Dragula spike</h3>
<div class="wrapper">
  <div class="container" v-dragula="demoStuff">
    <div v-for="text in demoStuff" :key="text">
      <div class="draggy">{{ text }}</div>
    </div>
  </div>
</div>
</div>
</template>

<script>
export default {
  data () {
    return {
      demoStuff: [
        'any',
        'body',
        'home'
      ]
    };
  }
};
</script>

What am I missing to get this plugin working properly?? Any help much appreciated

This question is available on Nuxt.js community (#c1162)