智慧园区前端大屏
linwe
2024-11-07 05affc703e81728cc58cc89c1815407ad4997dfe
src/store/router.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-11-06 10:46:45
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-06 10:56:14
 * @LastEditTime: 2024-11-07 18:58:32
 * @FilePath: \bigScreen\src\store\router.js
 * @Description: 
 * 
@@ -14,7 +14,8 @@
export const useRouterStore = defineStore('useRouterStore', {
  // 存储状态的地方,相当于 Vuex 的 state
  state: () => ({
    loadSub: false
    loadSub: false,
    loadSingle: false,
  }),
  // 相当于 Vuex 的 getters,用于计算状态
@@ -27,6 +28,10 @@
    setLoadSub (flag) {
      this.loadSub = flag
    },
    setLoadSingle (flag) {
      this.loadSingle = flag
    },
  },
  persist: {
@@ -37,6 +42,11 @@
        paths: ['loadSub'],
        storage: localStorage,
      },
      {
        key: 'loadSingle',
        paths: ['loadSingle'],
        storage: localStorage,
      },
    ]
  }
})