homesearch.js 559 B

12345678910111213141516171819202122232425
  1. import PersistedState from '../PersistedState'
  2. // search.js
  3. // initial state
  4. const state = {
  5. currentKey: PersistedState.getStorage('homesearch','currentKey', ''),
  6. currenKeywords: PersistedState.getStorage('homesearch','currenKeywords', []),
  7. }
  8. // mutations
  9. const mutations = {
  10. //
  11. changeKey (state, value) {
  12. state.currentKey = value
  13. PersistedState.setStorage('homesearch',state)
  14. },
  15. saveKeywords(state, value){
  16. state.currenKeywords = value
  17. PersistedState.setStorage('homesearch',state)
  18. }
  19. }
  20. export default {
  21. state,
  22. mutations
  23. }