sysStore.ts 395 B

1234567891011121314151617
  1. import {defineStore} from "pinia";
  2. // defineStore 调用后返回一个函数,调用该函数获得 Store 实体
  3. export const useSysStore = defineStore({
  4. // id: 必须的,在所有 Store 中唯一
  5. id: "sys_store",
  6. // state: 返回对象的函数
  7. state: () => ({
  8. // 是否运行在后台
  9. show: false
  10. }),
  11. actions: {
  12. setShow(show: boolean): void {
  13. this.show = show;
  14. }
  15. },
  16. });