Where is the Vuex store at Nuxt

Just trying to plunge into Vuex / Nuxt, also brand new for nodejs.

Given that nuxt is a server-side rendering application, where Vuex is located. In standard Vue, Vuex is a client-side repository. How does it work in Nuxt? Is it still a client-side repository, but just displayed on the server?

If it stays on the server, I’m just wondering how it processes the user’s data - or it shares it somehow. thank.

+4
source share
1 answer

SSR and rehydration:

Both client and server maintain state. When the client makes the first request to load the start page, the state usually passes through the html document inside the script, something like:

<script type="text/javascript" defer>window.__NUXT__={"data":[{"name":"server"}],"error":null,"serverRendered":true}</script>

, js load , . .

Nuxt:

Nuxt:

- Nuxt Vuex:

https://nuxtjs.org/examples/vuex-store

Vue SSR:

, vue ssr, , , :

HTML. , .

+3

Source: https://habr.com/ru/post/1694321/


All Articles