eolant / vuetify-toast-snackbar

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

VSnackbar component not found when using Vue Cli 3.0 #30

Closed jonaswikstrom closed 4 years ago

jonaswikstrom commented 4 years ago

Probably an issue regarding me as a newbie: but

When creating project using Vue cli 3.0 vuetify is imported with

import vuetify from './plugins/vuetify';`

Using import vuetify, { VIcon, VSnackbar } from './plugins/vuetify';

Results in: export 'VSnackbar' was not found in './plugins/vuetify'

and

Unknown custom element: <v-snackbar> - did you register the component correctly?

eolant commented 4 years ago

Hi there,

Have to be import Vuetify, { VSnackbar, VBtn, VIcon } from 'vuetify/lib' You either have to export these components from your ./plugins/vuetify or use vuetify/lib

fnoop commented 4 years ago
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)

This doesn't work getting the same error as above. Using the standard vuetify webpack setup. @vue/cli 4.2.3 vuetify@2.2.18

kakulukia commented 2 years ago

I also get the same error as above. @eolant could you explain the error in fnoops code?