Commit ef02c037 authored by Edgar Z. Alvarenga's avatar Edgar Z. Alvarenga

Use vuex-persist to sync vuex with localstorage (Fix #12)

parent d2f1c577
This diff is collapsed.
......@@ -37,7 +37,8 @@
"vue-head": "2.0.12",
"vue-router": "3.0.1",
"vuetify": "1.2.3",
"vuex": "3.0.1"
"vuex": "3.0.1",
"vuex-persist": "^2.0.0"
},
"devDependencies": {
"autoprefixer": "8.5.0",
......
......@@ -3,15 +3,21 @@ import Vuex from 'vuex'
import user from './modules/user'
import school from './modules/school'
import getters from './getters'
import VuexPersistence from 'vuex-persist'
Vue.use(Vuex)
const vuexLocal = new VuexPersistence({
storage: window.localStorage
})
const store = new Vuex.Store({
modules: {
user,
school
},
getters
getters,
plugins: [vuexLocal.plugin]
})
export default store
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment