Files
cmanager/src/store/modules/cmanageTitle.js

27 lines
822 B
JavaScript
Raw Normal View History

2024-02-02 15:04:47 +08:00
import {setStore, getStore} from '@/util/store'
const cmanageTitle = {
state: {
isSearch: getStore({name: 'isSearch'}) || false,
searchInput: getStore({name: 'searchInput'}) || '',
},
actions: {
layoutIsSearch ({commit}, type) {
commit('SET_ISSEARCH', type)
},
layoutIsSearchInput ({commit}, str) {
commit('SET_SEARCHINPUT', str)
}
},
mutations: {
SET_ISSEARCH: (state, type) => {
state.isSearch = type;
setStore({name: 'isSearch', content: state.isSearch, type: 'local'})
},
SET_SEARCHINPUT: (state, str) => {
state.searchInput = str;
setStore({name: 'searchInput', content: state.searchInput, type: 'local'})
},
}
}
export default cmanageTitle