国际化支持

This commit is contained in:
liuhanqing
2025-05-23 10:33:30 +08:00
parent fd1c9ef5e8
commit 1f61c0c84a
13 changed files with 339 additions and 101 deletions

View File

@@ -7,7 +7,8 @@ const state = {
hide: false
},
device: 'desktop',
size: Cookies.get('size') || 'medium'
size: Cookies.get('size') || 'medium',
language: Cookies.get('language') || 'en'
}
const mutations = {
@@ -37,6 +38,10 @@ const mutations = {
},
SET_SIDEBAR_HIDE: (state, status) => {
state.sidebar.hide = status
},
SET_LANGUAGE: (state, language) => {
state.language = language
Cookies.set('language', language)
}
}
@@ -55,6 +60,9 @@ const actions = {
},
toggleSideBarHide({ commit }, status) {
commit('SET_SIDEBAR_HIDE', status)
},
setLanguage({ commit }, language) {
commit('SET_LANGUAGE', language)
}
}