feature: add global size option (#1024)

This commit is contained in:
花裤衩
2018-08-29 15:24:47 +08:00
committed by GitHub
parent 5bbb4abe21
commit 0fbda3c8c7
11 changed files with 112 additions and 6 deletions

View File

@@ -7,7 +7,8 @@ const app = {
withoutAnimation: false
},
device: 'desktop',
language: Cookies.get('language') || 'en'
language: Cookies.get('language') || 'en',
size: Cookies.get('size') || 'medium'
},
mutations: {
TOGGLE_SIDEBAR: state => {
@@ -30,6 +31,10 @@ const app = {
SET_LANGUAGE: (state, language) => {
state.language = language
Cookies.set('language', language)
},
SET_SIZE: (state, size) => {
state.size = size
Cookies.set('size', size)
}
},
actions: {
@@ -44,6 +49,9 @@ const app = {
},
setLanguage({ commit }, language) {
commit('SET_LANGUAGE', language)
},
setSize({ commit }, size) {
commit('SET_SIZE', size)
}
}
}