Newer
Older
intelligentRobot / src / store / modules / runPoint.ts
wangxitong on 3 Sep 560 bytes first commit
import { defineStore } from 'pinia'

const detectorHSStore = defineStore(
  'runPoint',
  {
    persist: {
      enabled: true,//开启数据持久化
      strategies: [
        {
          key: 'run-point',//给一个要保存的名称
          storage: localStorage,// localStorage 存储方式为本地存储
        }
      ]
    },
    state: () => ({
      points: [],
    }),
    actions: {
      push(data: any) {
        this.points.push(data)
      },
      clear() {
        this.points = []
      },
    },
  },
)

export default detectorHSStore