Created
March 24, 2020 03:16
-
-
Save hoangtuan151/1615ecaf2d4de6d3b5bdbf154cf74efa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vuexPersist = new VuexPersist({ | |
key: 'app-store', | |
storage: window.localStorage, | |
reducer: state => ({ | |
app_locale: state.app_locale | |
}) | |
}) | |
export default new Vuex.Store({ | |
plugins: [vuexPersist.plugin], | |
state: { | |
app_locale: 'en', | |
}, | |
mutations: { | |
SET_APP_LOCALE (state, payload) { | |
state.app_locale = payload | |
}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment