search.js 433 B

12345678910111213141516171819202122
  1. export const state = () => ({
  2. keywords: {
  3. fetching: false,
  4. data: []
  5. }
  6. })
  7. export const mutations = {
  8. REQUEST_KEYWORDS (state) {
  9. state.keywords.fetching = true
  10. },
  11. GET_KEYWORDS_FAILURE (state) {
  12. state.keywords.fetching = false
  13. },
  14. GET_KEYWORDS_SUCCESS (state, result) {
  15. state.keywords.fetching = false
  16. state.keywords.data = result
  17. },
  18. RESET_KEYWORDS (state) {
  19. state.keywords.data = []
  20. }
  21. }