From d04c67f0ea17e9d948f0ff3e51fda76aa4cd44f6 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Thu, 20 Jun 2024 15:31:54 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=96=B0=E5=A2=9EVITE=5FHIDE=5FGLOBAL?= =?UTF-8?q?=5FSETTING=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.base | 3 +++ .env.dev | 3 +++ .env.gitee | 3 +++ .env.pro | 3 +++ .env.test | 3 +++ src/layout/Layout.vue | 4 +++- types/global.d.ts | 1 + 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.env.base b/.env.base index 1c8fd7c..23fc7a4 100644 --- a/.env.base +++ b/.env.base @@ -18,3 +18,6 @@ VITE_USE_MOCK=true # 是否使用在线图标 VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false diff --git a/.env.dev b/.env.dev index a4d6b3a..792c9ea 100644 --- a/.env.dev +++ b/.env.dev @@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=true # 是否使用在线图标 VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false diff --git a/.env.gitee b/.env.gitee index 1a14f0a..5536574 100644 --- a/.env.gitee +++ b/.env.gitee @@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=true # 是否使用在线图标 VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false diff --git a/.env.pro b/.env.pro index edc668e..7db3d27 100644 --- a/.env.pro +++ b/.env.pro @@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=true # 是否使用在线图标 VITE_USE_ONLINE_ICON=false + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false diff --git a/.env.test b/.env.test index b53f347..e589b03 100644 --- a/.env.test +++ b/.env.test @@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=false # 是否使用在线图标 VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue index 6317695..c807392 100644 --- a/src/layout/Layout.vue +++ b/src/layout/Layout.vue @@ -20,6 +20,8 @@ const collapse = computed(() => appStore.getCollapse) const layout = computed(() => appStore.getLayout) +const hideSetting = computed(() => import.meta.env.VITE_HIDE_GLOBAL_SETTING === 'true') + const handleClickOutside = () => { appStore.setCollapse(true) } @@ -59,7 +61,7 @@ export default defineComponent({ - + {!unref(hideSetting) && } ) } diff --git a/types/global.d.ts b/types/global.d.ts index ea0fa77..c8ef5ed 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -82,5 +82,6 @@ declare global { readonly VITE_USE_CSS_SPLIT: string readonly VITE_USE_ONLINE_ICON: string readonly VITE_ICON_PREFIX: string + readonly VITE_HIDE_GLOBAL_SETTING: string } }