Files
admin-sjzx/src/stores/monitoringPoint.ts
2024-02-28 14:19:56 +08:00

25 lines
518 B
TypeScript

import { reactive } from 'vue'
import { defineStore } from 'pinia'
interface MonitoringPoint {
lineId: string
lineName: string
}
export const useMonitoringPoint = defineStore(
'monitoringPoint',
() => {
const state: MonitoringPoint = reactive({
lineId: '',
lineName: '',
})
const setValue = (key: keyof MonitoringPoint, val: any) => {
state[key] = val
}
return { state, setValue }
},
{
persist: true
}
)