formConfig.js 433 B

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