Files
admin-sjzx/src/stores/monitoringPoint.ts

25 lines
518 B
TypeScript
Raw Normal View History

2024-02-22 14:51:05 +08:00
import { reactive } from 'vue'
import { defineStore } from 'pinia'
interface MonitoringPoint {
lineId: string
2024-02-26 10:43:33 +08:00
lineName: string
2024-02-22 14:51:05 +08:00
}
export const useMonitoringPoint = defineStore(
'monitoringPoint',
() => {
const state: MonitoringPoint = reactive({
2024-02-26 10:43:33 +08:00
lineId: '',
lineName: '',
2024-02-22 14:51:05 +08:00
})
const setValue = (key: keyof MonitoringPoint, val: any) => {
state[key] = val
}
return { state, setValue }
2024-02-26 10:43:33 +08:00
},
{
persist: true
2024-02-22 14:51:05 +08:00
}
)