mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
32 lines
450 B
JavaScript
32 lines
450 B
JavaScript
const state = {
|
|
lang: window.localStorage.getItem('lang') || 'en'
|
|
}
|
|
|
|
const getters = {
|
|
lang (state) {
|
|
if (state.lang === 'en') {
|
|
return 'English'
|
|
} else if (state.lang === 'zh') {
|
|
return '中文'
|
|
} else {
|
|
return state.lang
|
|
}
|
|
}
|
|
}
|
|
|
|
const mutations = {
|
|
SET_LANG (state, value) {
|
|
state.lang = value
|
|
}
|
|
}
|
|
|
|
const actions = {}
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state,
|
|
getters,
|
|
mutations,
|
|
actions
|
|
}
|