mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
39 lines
1006 B
TypeScript
39 lines
1006 B
TypeScript
import { defineStore } from 'pinia';
|
|
import config from '@/config';
|
|
|
|
export const useCustomizerStore = defineStore("customizer", {
|
|
state: () => ({
|
|
Sidebar_drawer: config.Sidebar_drawer,
|
|
Customizer_drawer: config.Customizer_drawer,
|
|
mini_sidebar: config.mini_sidebar,
|
|
fontTheme: "Noto Sans SC",
|
|
uiTheme: config.uiTheme,
|
|
inputBg: config.inputBg,
|
|
chatSidebarOpen: false // chat mode mobile sidebar state
|
|
}),
|
|
|
|
getters: {},
|
|
actions: {
|
|
SET_SIDEBAR_DRAWER() {
|
|
this.Sidebar_drawer = !this.Sidebar_drawer;
|
|
},
|
|
SET_MINI_SIDEBAR(payload: boolean) {
|
|
this.mini_sidebar = payload;
|
|
},
|
|
SET_FONT(payload: string) {
|
|
this.fontTheme = payload;
|
|
},
|
|
SET_UI_THEME(payload: string) {
|
|
this.uiTheme = payload;
|
|
localStorage.setItem("uiTheme", payload);
|
|
},
|
|
|
|
TOGGLE_CHAT_SIDEBAR() {
|
|
this.chatSidebarOpen = !this.chatSidebarOpen;
|
|
},
|
|
SET_CHAT_SIDEBAR(payload: boolean) {
|
|
this.chatSidebarOpen = payload;
|
|
},
|
|
}
|
|
});
|