yariksav / vuetify-dialog

Easy dialogs in Vuetify.js framework
MIT License
195 stars 48 forks source link

this.$nuxt not defined #129

Open Parakoos opened 3 years ago

Parakoos commented 3 years ago

Inside my dialogs, I don't seem to have access to the $nuxt helper class. So, if I have a getter like this:

get isOffline() {
    return this.$nuxt.isOffline
}

I get an error that this.$nuxt is undefined.

I open my dialog by calling

import ReorderDialog from './ReorderDialog.vue'
...
this.$dialog.show(ReorderDialog, {})

I have access to all other Nuxt-injected modules except the $nuxt helper. I have taken the advice found in this forum to move the vuetify-dialog plugin to be the last-loaded plugin. (via extendPlugins in nuxt.config.ts)

Only thing i really use the $nuxt for is to get reactive feedback on offline/online status (to turn buttons on/off) so if there is a better way of doing this that avoids using nuxt, then I could take that help too! :-)