Nuxt/examples/i18n/store/index.js

13 lines
210 B
JavaScript
Raw Normal View History

export const state = {
2017-04-14 09:55:04 +00:00
locales: ['en', 'fr'],
locale: 'en'
}
export const mutations = {
SET_LANG (state, locale) {
2017-04-14 09:55:04 +00:00
if (state.locales.indexOf(locale) !== -1) {
state.locale = locale
}
}
}