Answer the question
In order to leave comments, you need to log in
How to get access to the hooks of the entire application in nuxt?
In pure vue, there is an App.vue file, which has access to all application hooks and calls the necessary methods at the time of application initialization. How to repeat the same on nuxt?
I need to load categories in vuex regardless of which page the application was opened on.
Answer the question
In order to leave comments, you need to log in
It's called plugins! https://nuxtjs.org/api/configuration-plugins#the-p...
And if ssr - that is, in /store/index.js action nuxtServerInit
There is also an analogy nuxtServerInit, but for the client part - https:// www.npmjs.com/package/nuxt-client-init-module, same plugin wrapped in a module
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question