1.4.0 • Published 4 years ago
nuxt-spa-store-init v1.4.0
nuxt-spa-store-init
A simple Nuxt module that will hydrate the VueX store when running in SPA mode, whether this is because you are running yarn dev --spa or you're using the fallback option of yarn generate. It is based on this comment as well as this comment and calls the root Vuex action nuxtServerInit() if it hasn't run yet.
Install
yarn add nuxt-spa-store-initornpm install --save nuxt-spa-store-init- Add to
nuxt.config.jsunder modules:modules: ['nuxt-spa-store-init']
Usage
Ensure your nuxtServerInit action in store/index.js returns a Promise. Other than that, it just works automatically.