Nuxt/examples/i18n/store/index.js

13 lines
217 B
JavaScript
Raw Normal View History

2017-05-21 19:01:08 +00:00
export const state = () => ({
2017-04-14 09:55:04 +00:00
locales: ['en', 'fr'],
locale: 'en'
2017-05-21 19:01:08 +00:00
})
export const mutations = {
2017-10-31 13:43:55 +00:00
SET_LANG(state, locale) {
2017-04-14 09:55:04 +00:00
if (state.locales.indexOf(locale) !== -1) {
state.locale = locale
}
}
}