vuetify-toast-snackbar icon indicating copy to clipboard operation
vuetify-toast-snackbar copied to clipboard

There is no 'plugins/vuetify.js' in nuxt

Open maratumba opened this issue 5 years ago • 2 comments

I'm using nuxt with vuetify. The instructions say to update plugins/vuetify.js to add the toast-snackbar but I don't have this in my default nuxt-vuetify config, which uses @nuxtjs/vuetify module.

I've tried to create a plugin anyway. But I'm getting an Unknown custom element: <v-snackbar> error after I added a plugins/toast.js file, added it to the plugins list in nuxt.config.js and put the following in it:

import Vue from 'vue'
import Vuetify, { VSnackbar, VBtn, VIcon } from 'vuetify/lib'
import VuetifyToast from 'vuetify-toast-snackbar'

Vue.use(Vuetify, {
  components: {
    VSnackbar,
    VBtn,
    VIcon
  }
})

Vue.use(VuetifyToast)

I'm not sure what to do.

"@nuxt/cli": {
      "version": "2.11.0",
"@nuxtjs/vuetify": {
      "version": "1.11.0",
"vuetify": {
      "version": "2.2.14",
"vuetify-toast-snackbar": {
      "version": "0.6.1",

maratumba avatar May 24 '20 17:05 maratumba

here is what works for me, hope it will work for you as well: under plugins, a file called vuetify.js

import Vue from 'vue'
import VuetifyToast from 'vuetify-toast-snackbar'

Vue.use(VuetifyToast)

in nuxt.config.js, in the plugins array, add this:

'@/plugins/vuetify',

let me know how it goes ;)

RonAlmog avatar May 28 '20 21:05 RonAlmog

maybe try https://github.com/eolant/vuetify-toast-snackbar/issues/42#issuecomment-646499345

puzzle9 avatar Aug 15 '20 16:08 puzzle9