gestionar idioma con states de vuex

This commit is contained in:
María
2025-07-29 17:38:12 +02:00
committed by María
parent 8a92b3d1f9
commit fb4c831c06
10 changed files with 124 additions and 24 deletions

18
store/langcode.js Normal file
View File

@@ -0,0 +1,18 @@
export const langcodeModule = {
state: () => ({
langcode: 'es'
}),
mutations: {
SET_LANGCODE: (state, langcode) => {
state.langcode = langcode;
}
},
actions: {
setLangcode: ({ commit }, langcode) => {
commit("SET_LANGCODE", langcode);
}
},
getters: {
langcode: (state) => state.langcode
},
};