import { defineStore } from 'pinia' export interface IAppState { isCollapse: boolean name?: string doctitle?: string backgroundColor: string } export const useAppStore = defineStore('useAppStore', { state: (): IAppState => { return { isCollapse: false, name: '', doctitle: '', backgroundColor: '#fff', } }, actions: { collapse() { this.isCollapse = !this.isCollapse }, appName(appinfo) { this.name = appinfo.name }, changeTitle(title) { this.doctitle = title }, setBgColor(color = '#fff') { this.backgroundColor = color }, }, })