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

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

    // 保存
    function setInspectionValueData(data) {
      inspectionValue.data = data;
    }
    
    // 清空
    function clearInspectionValueData() {
      console.log(inspectionValue.data)
      inspectionValue.data = null;
    }

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