Nuxt/examples/i18n/store/index.js

13 lines
212 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 = {
SET_LANG (state, locale) {
if (state.locales.includes(locale)) {
state.locale = locale
}
}
}