0👍
As it says in the documentation, you really need to have that function in the index.js
file inside the store
folder, which will not work otherwise.
here’s an example of a production NuxtJs universal application with the ./store/index.js
only with that file, you can easily call other stores methods by prefixing them with the file name, as the example shows auth/setAuth
- [Vuejs]-How to avoid repeating of code in vuetify?
- [Vuejs]-How do I use the render function correctly in Vue?
0👍
I just faced the problem that nuxtServerInit was not called. The reason was in nuxt.config.js where ssr was set to false.
nuxt.config.js
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
// ssr: false, <-- Remove or out comment the line
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: 'server',
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
}
}
- [Vuejs]-Access Vuex store from javascript module
- [Vuejs]-Force computed variable to update (Firebase VueJS)
Source:stackexchange.com