feat:更新代码
This commit is contained in:
@@ -6,7 +6,7 @@ export const useAppStore = defineStore(
|
||||
{
|
||||
state: () => ({
|
||||
sidebar: {
|
||||
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
|
||||
opened: true,
|
||||
withoutAnimation: false,
|
||||
hide: false
|
||||
},
|
||||
@@ -14,20 +14,14 @@ export const useAppStore = defineStore(
|
||||
size: Cookies.get('size') || 'default'
|
||||
}),
|
||||
actions: {
|
||||
toggleSideBar(withoutAnimation) {
|
||||
toggleSideBar(withoutAnimation) {
|
||||
if (this.sidebar.hide) {
|
||||
return false;
|
||||
}
|
||||
this.sidebar.opened = !this.sidebar.opened
|
||||
this.sidebar.withoutAnimation = withoutAnimation
|
||||
if (this.sidebar.opened) {
|
||||
// Cookies.set('sidebarStatus', 1)
|
||||
} else {
|
||||
// Cookies.set('sidebarStatus', 0)
|
||||
}
|
||||
this.sidebar.opened = !this.sidebar.opened
|
||||
this.sidebar.withoutAnimation = withoutAnimation
|
||||
},
|
||||
closeSideBar({ withoutAnimation }) {
|
||||
// Cookies.set('sidebarStatus', 0)
|
||||
closeSideBar({ withoutAnimation }) {
|
||||
this.sidebar.opened = false
|
||||
this.sidebar.withoutAnimation = withoutAnimation
|
||||
},
|
||||
@@ -38,7 +32,7 @@ export const useAppStore = defineStore(
|
||||
this.size = size;
|
||||
Cookies.set('size', size)
|
||||
},
|
||||
toggleSideBarHide(status) {
|
||||
toggleSideBarHide(status) {
|
||||
this.sidebar.hide = status
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user