vuetify-dialog icon indicating copy to clipboard operation
vuetify-dialog copied to clipboard

this.$nuxt not defined

Open Parakoos opened this issue 3 years ago • 0 comments

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! :-)

Parakoos avatar Apr 23 '21 13:04 Parakoos