import { getConfig } from "@/config/config"

export const useSettingStore = defineStore("userSetting", {
    state: () => ({
        collapse: false,
        layoutStyle: "vertical",
        title: "",
        theme: "#409EFF"
    }),
    persist: {
        enabled: true,
        strategies: [{ key: "useSetting", storage: localStorage }]
    },
    getters: {},
    actions: {
        setTitle(title) {
            this.title = title
            document.title = getConfig("projectName") + "-" + title
        }
    }
})