form.ts 555 B

12345678910111213141516171819202122232425
  1. import {formState} from '~/types/interfaces'
  2. import {FORM_STATUS} from "~/types/enums";
  3. import {defineStore} from "pinia";
  4. export const useFormStore = defineStore('form', {
  5. state: (): formState => {
  6. return {
  7. formStatus: FORM_STATUS.EDIT,
  8. violations: [],
  9. readonly: false,
  10. dirty: false,
  11. showConfirmToLeave: false,
  12. goAfterLeave: null
  13. }
  14. }
  15. })
  16. export const state = () => ({
  17. formStatus: FORM_STATUS.EDIT,
  18. violations: [],
  19. readonly: false,
  20. dirty: false,
  21. showConfirmToLeave: false,
  22. goAfterLeave: null
  23. })