25 lines
518 B
TypeScript
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
|
|
}
|
|
)
|