概要ブラウザのリロード時にストアに保持していたデータは破棄されてしまう。 ユーザの操作上リロードが許容すべきセッション情報や更新頻度の高くない情報は保持しておきたい場面がある。 vuex-persistedstateを利用する。(localForgeには対応していない) npm install vuex-persistedstate をした後、下記のように Store のプラグインとして定義する。 import Vue from "vue"; import Vuex from "vuex"; import createPersistedState from "vuex-persistedstate"; Vue.use(Vuex); export default new Vuex.Store({ state: { token: "", }, mutations: {}, getters: {