BKWLD

Nuxt spa store init

A simple Nuxt module that will hydrate the VueX store when running in SPA mode (not SSR)

Version Version: 1.2.1 Version Updated: 09/11/2020 By: BKWLD License: MIT

DownloadsLast30Days: 1.1k

https://github.com/BKWLD/nuxt-spa-store-init

npm i nuxt-spa-store-init
yarn add nuxt-spa-store-init

nuxt-spa-store-init

A simple Nuxt module that will hydrate the VueX store when running in SPA mode (not SSR). It is based on this comment and calls the root Vuex action nuxtServerInit() manually when Nuxt's mode is spa.

Install

  1. yarn add nuxt-spa-store-init or npm install --save nuxt-spa-store-init
  2. Add to nuxt.config.js under modules: modules: ['nuxt-spa-store-init']

Usage

Make sure your nuxtServerInit action in store/index.js returns a Promise. Other than that, it just works automatically.

Contributors


Dependencies


DevDependencies