eolant / vuetify-toast-snackbar

Basic Vue toast service that uses Vuetify Snackbar component.
MIT License
127 stars 36 forks source link

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

Open maratumba opened 4 years ago

maratumba commented 4 years ago

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",
RonAlmog commented 4 years ago

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 ;)

puzzle9 commented 4 years ago

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