checkinInfoStore.js 423 B

12345678910111213141516171819202122232425
  1. import {
  2. defineStore
  3. } from 'pinia'
  4. export const useCheckinInfoStore = defineStore('checkinInfo', {
  5. state: () => {
  6. return {
  7. checkinInfo: []
  8. }
  9. },
  10. actions: {
  11. removeCheckinInfoAt(n) {
  12. if (n < this.idCardInfo.length && n >= 0) {
  13. this.checkinInfo.splice(n, 1)
  14. }
  15. },
  16. addCheckinInfo(info) {
  17. this.checkinInfo.push(info)
  18. },
  19. clearCheckinInfo() {
  20. this.checkinInfo = []
  21. }
  22. },
  23. unistorage: true
  24. })