You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
779 B
30 lines
779 B
import { defineStore } from "pinia"
|
|
|
|
const state = () => ({
|
|
sidebarStatus: {
|
|
opened: false,
|
|
withoutAnimation: false
|
|
},
|
|
device: 'desktop'
|
|
})
|
|
|
|
export const useAppStore = defineStore({
|
|
id: 'app',
|
|
state,
|
|
actions: {
|
|
ToggleSideBar() {
|
|
if (this.sidebarStatus.opened) {
|
|
localStorage.setItem('sidebarStatus', 1)
|
|
} else {
|
|
localStorage.setItem('sidebarStatus', 0)
|
|
}
|
|
this.sidebarStatus.opened = !this.sidebarStatus.opened
|
|
},
|
|
CloseSideBar({ withoutAnimation }) {
|
|
localStorage.setItem('sidebarStatus', 1)
|
|
this.sidebarStatus.opened = false
|
|
this.sidebarStatus.withoutAnimation = withoutAnimation
|
|
}
|
|
}
|
|
})
|