From 264806b27513ef66d13b079df9f65f8f376a5e1b Mon Sep 17 00:00:00 2001 From: zouzhibing Date: Wed, 24 Aug 2022 18:53:05 +0800 Subject: [PATCH] =?UTF-8?q?feature:=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{u-setting => u-theme}/index.vue | 23 +++++++++++++++---- src/layout/Header/index.vue | 8 +++---- src/layout/Main/index.vue | 4 ++-- src/layout/Sidebar/components/Menu.vue | 3 +-- src/layout/index.vue | 10 ++++---- src/store/modules/setting.ts | 12 ++++++++-- 6 files changed, 40 insertions(+), 20 deletions(-) rename src/components/{u-setting => u-theme}/index.vue (85%) diff --git a/src/components/u-setting/index.vue b/src/components/u-theme/index.vue similarity index 85% rename from src/components/u-setting/index.vue rename to src/components/u-theme/index.vue index e967a6f..608db78 100644 --- a/src/components/u-setting/index.vue +++ b/src/components/u-theme/index.vue @@ -13,8 +13,12 @@ -
- +
+ + +
+
+
-
+
@@ -34,7 +38,7 @@ diff --git a/src/layout/index.vue b/src/layout/index.vue index 7c0fdf0..7af0581 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -9,7 +9,7 @@ }" > -
+
@@ -51,18 +51,18 @@ const handleClickOutside = () => { store.dispatch('app/closeSideBar', { withoutAnimation: false }) } - const isShowTag = computed(() => { - return store.state.setting.isShowTag + const showTag = computed(() => { + return store.state.setting.themeConfig.showTag }) const mode = computed(() => { - return store.state.setting.mode + return store.state.setting.themeConfig.mode }) return { isCollapse, device, classObj, - isShowTag, + showTag, mode, handleClickOutside, } diff --git a/src/store/modules/setting.ts b/src/store/modules/setting.ts index c13b781..ebf7b09 100644 --- a/src/store/modules/setting.ts +++ b/src/store/modules/setting.ts @@ -1,16 +1,24 @@ import {Module} from "vuex"; const state = { + themeConfig:{ + // 菜单展示模式 默认 vertical horizontal / vertical + mode: 'vertical', + // tagsView 是否展示 + showTag:true, // 默认展示 + // 页脚 + footer: true + }, isShowTag: true, mode: 'vertical', } const mutations = { SET_TAG: (state, value) => { - state.isShowTag = value + state.themeConfig.showTag = value }, SET_MODE: (state, value) => { - state.mode = value + state.themeConfig.mode = value }, } const actions = {