// 小仓库：layout组件的配置
import { defineStore } from "pinia";
export const useUserSetting = defineStore({
  id: "user-setting",
  state: () => {
    return {
      collapsed: false, //侧边栏折叠
      selectedKeys: "",
      refresh: false, //全局刷新
    };
  },
  actions: {
    toggleCollapsed() {
      this.collapsed = !this.collapsed;
    },
    refreshPage() {
      this.refresh = !this.refresh;
    },
    setSelectedKeys(key: string) {
      this.selectedKeys = key;
    },
  },
  getters: {},
  persist: {},
});
