style: 代码统一风格格式化
Former-commit-id: 5d0a75e41127c57c663eb2617b1ce66d039f4c29
This commit is contained in:
@@ -4,45 +4,45 @@ import { defineStore } from 'pinia';
|
||||
import { getLanguage } from '@/lang/index';
|
||||
|
||||
const useAppStore = defineStore({
|
||||
id: 'app',
|
||||
state: (): AppState => ({
|
||||
device: 'desktop',
|
||||
sidebar: {
|
||||
opened: localStorage.get('sidebarStatus')
|
||||
? !!+localStorage.get('sidebarStatus')
|
||||
: true,
|
||||
withoutAnimation: false
|
||||
},
|
||||
language: getLanguage(),
|
||||
size: localStorage.get('size') || 'default'
|
||||
}),
|
||||
actions: {
|
||||
toggleSidebar() {
|
||||
this.sidebar.opened = !this.sidebar.opened;
|
||||
this.sidebar.withoutAnimation = false;
|
||||
if (this.sidebar.opened) {
|
||||
localStorage.set('sidebarStatus', 1);
|
||||
} else {
|
||||
localStorage.set('sidebarStatus', 0);
|
||||
}
|
||||
},
|
||||
closeSideBar(withoutAnimation: any) {
|
||||
localStorage.set('sidebarStatus', 0);
|
||||
this.sidebar.opened = false;
|
||||
this.sidebar.withoutAnimation = withoutAnimation;
|
||||
},
|
||||
toggleDevice(device: string) {
|
||||
this.device = device;
|
||||
},
|
||||
setSize(size: string) {
|
||||
this.size = size;
|
||||
localStorage.set('size', size);
|
||||
},
|
||||
setLanguage(language: string) {
|
||||
this.language = language;
|
||||
localStorage.set('language', language);
|
||||
}
|
||||
}
|
||||
id: 'app',
|
||||
state: (): AppState => ({
|
||||
device: 'desktop',
|
||||
sidebar: {
|
||||
opened: localStorage.get('sidebarStatus')
|
||||
? !!+localStorage.get('sidebarStatus')
|
||||
: true,
|
||||
withoutAnimation: false
|
||||
},
|
||||
language: getLanguage(),
|
||||
size: localStorage.get('size') || 'default'
|
||||
}),
|
||||
actions: {
|
||||
toggleSidebar() {
|
||||
this.sidebar.opened = !this.sidebar.opened;
|
||||
this.sidebar.withoutAnimation = false;
|
||||
if (this.sidebar.opened) {
|
||||
localStorage.set('sidebarStatus', 1);
|
||||
} else {
|
||||
localStorage.set('sidebarStatus', 0);
|
||||
}
|
||||
},
|
||||
closeSideBar(withoutAnimation: any) {
|
||||
localStorage.set('sidebarStatus', 0);
|
||||
this.sidebar.opened = false;
|
||||
this.sidebar.withoutAnimation = withoutAnimation;
|
||||
},
|
||||
toggleDevice(device: string) {
|
||||
this.device = device;
|
||||
},
|
||||
setSize(size: string) {
|
||||
this.size = size;
|
||||
localStorage.set('size', size);
|
||||
},
|
||||
setLanguage(language: string) {
|
||||
this.language = language;
|
||||
localStorage.set('language', language);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default useAppStore;
|
||||
|
||||
Reference in New Issue
Block a user