mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 22:35:21 +00:00
30 lines
643 B
JavaScript
30 lines
643 B
JavaScript
import VueCookie from 'vue-cookie'
|
|
import Vue from 'vue'
|
|
|
|
function getTableConfigfromCookie() {
|
|
console.log(VueCookie.get('tableConfig') ? JSON.parse(VueCookie.get('tableConfig')) : {})
|
|
return VueCookie.get('tableConfig') ? JSON.parse(VueCookie.get('tableConfig')) : {}
|
|
}
|
|
|
|
const state = {
|
|
tableConfig: getTableConfigfromCookie()
|
|
}
|
|
|
|
const mutations = {
|
|
SET_TABLE_CONFIG: (state, tableConfig) => {
|
|
Vue.set(state.tableConfig, tableConfig.key, tableConfig.value)
|
|
VueCookie.set('tableConfig', JSON.stringify(state.tableConfig), 14)
|
|
}
|
|
}
|
|
|
|
const actions = {
|
|
|
|
}
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state,
|
|
mutations,
|
|
actions
|
|
}
|