I would like to write a getter to return this.$nuxt.$loading
from a vuex store file.
(/)
This question is linked to my other question: Nuxt/Vue: How to position custom loading ponent
And now I thought of listening to this loading property to display my Loading ponent within the page.
The Loading property looks like this:
So I would like to return this.$nuxt.$loading.data.$route.show
from the vuex store. If it is true, I want to show my custom loader and if its false not – of course.
To do that I would like to access this.$nuxt
but this is undefined in my vuex store. It is only present in my ponents...
I tried $nuxt
– same result.
I don't know if this is right or at least one way to achieve what I want, and I am definitely open for suggestions.
Thanks in advance. Cheers
I would like to write a getter to return this.$nuxt.$loading
from a vuex store file.
(https://nuxtjs/api/configuration-loading/)
This question is linked to my other question: Nuxt/Vue: How to position custom loading ponent
And now I thought of listening to this loading property to display my Loading ponent within the page.
The Loading property looks like this:
So I would like to return this.$nuxt.$loading.data.$route.show
from the vuex store. If it is true, I want to show my custom loader and if its false not – of course.
To do that I would like to access this.$nuxt
but this is undefined in my vuex store. It is only present in my ponents...
I tried $nuxt
– same result.
I don't know if this is right or at least one way to achieve what I want, and I am definitely open for suggestions.
Thanks in advance. Cheers
You can use window.$nuxt for this.
I used this._vm
.
You can see it in there if you do console.log(this)
in Vuex.