From 75cfe2f8f77a641469d62c8bf8d3c6a00a5604f1 Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: 星期六, 23 四月 2022 22:04:12 +0800
Subject: [PATCH] Merge pull request #48 from JavaLionLi/patch-1
---
src/store/modules/app.js | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index c8d8ee9..468299e 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -3,14 +3,18 @@
const state = {
sidebar: {
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
- withoutAnimation: false
+ withoutAnimation: false,
+ hide: false
},
device: 'desktop',
- size: Cookies.get('size') || 'medium'
+ size: Cookies.get('size') || 'default'
}
const mutations = {
TOGGLE_SIDEBAR: state => {
+ if (state.sidebar.hide) {
+ return false;
+ }
state.sidebar.opened = !state.sidebar.opened
state.sidebar.withoutAnimation = false
if (state.sidebar.opened) {
@@ -30,6 +34,9 @@
SET_SIZE: (state, size) => {
state.size = size
Cookies.set('size', size)
+ },
+ SET_SIDEBAR_HIDE: (state, status) => {
+ state.sidebar.hide = status
}
}
@@ -45,6 +52,9 @@
},
setSize({ commit }, size) {
commit('SET_SIZE', size)
+ },
+ toggleSideBarHide({ commit }, status) {
+ commit('SET_SIDEBAR_HIDE', status)
}
}
--
Gitblit v1.9.3