| | |
| | | { |
| | | state: () => ({ |
| | | sidebar: { |
| | | opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, |
| | | opened: true, |
| | | withoutAnimation: false, |
| | | hide: false |
| | | }, |
| | |
| | | }), |
| | | actions: { |
| | | toggleSideBar(withoutAnimation) { |
| | | return true |
| | | console.log('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) |
| | | } |
| | | }, |
| | | closeSideBar({ withoutAnimation }) { |
| | | Cookies.set('sidebarStatus', 0) |