1
0

Highlight the current list when something list related is called

This commit is contained in:
kolaente
2020-05-08 21:07:33 +02:00
parent 5724b98358
commit 8ae03fa6e9
5 changed files with 30 additions and 5 deletions

View File

@ -5,7 +5,7 @@ Vue.use(Vuex)
import config from './modules/config'
import auth from './modules/auth'
import namespaces from './modules/namespaces'
import {ERROR_MESSAGE, IS_FULLPAGE, LOADING, ONLINE} from './mutation-types'
import {CURRENT_LIST, ERROR_MESSAGE, IS_FULLPAGE, LOADING, ONLINE} from './mutation-types'
export const store = new Vuex.Store({
modules: {
@ -18,6 +18,8 @@ export const store = new Vuex.Store({
errorMessage: '',
online: true,
isFullpage: false,
// This is used to highlight the current list in menu for all list related views
currentList: 0,
},
mutations: {
[LOADING](state, loading) {
@ -31,6 +33,9 @@ export const store = new Vuex.Store({
},
[IS_FULLPAGE](state, fullpage) {
state.isFullpage = fullpage
}
},
[CURRENT_LIST](state, currentList) {
state.currentList = currentList
},
},
})

View File

@ -2,6 +2,7 @@ export const LOADING = 'loading'
export const ERROR_MESSAGE = 'errorMessage'
export const ONLINE = 'online'
export const IS_FULLPAGE = 'isFullpage'
export const CURRENT_LIST = 'currentList'
export const CONFIG = 'config'
export const AUTH = 'auth'