import { defineStore } from "pinia"
import { reactive } from 'vue'

export const useIncidentNumStore = defineStore(
  "incidentNum",
  () => {
    const incidentNum = reactive({
      data: null,
    });

    // 保存
    function setIncidentNumData(data) {
      incidentNum.data = data;
    }
    
    // 清空
    function clearIncidentNumData() {
      console.log(incidentNum.data)
      incidentNum.data = null;
    }

    return {
      incidentNum,
      setIncidentNumData,
      clearIncidentNumData,
    };
  },
  {
    unistorage: true, // 开启后对 state 的数据读写都将持久化
  },
);