初始化项目
This commit is contained in:
26
src/store/modules/cmanageTitle.js
Normal file
26
src/store/modules/cmanageTitle.js
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
Reference in New Issue
Block a user