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
