Nuxt/examples/i18n/store/index.js
2017-10-31 21:43:55 +08:00

13 lines
217 B
JavaScript

export const state = () => ({
locales: ['en', 'fr'],
locale: 'en'
})
export const mutations = {
SET_LANG(state, locale) {
if (state.locales.indexOf(locale) !== -1) {
state.locale = locale
}
}
}