From 40079fad074817a793089fc27c239be9f24d17a9 Mon Sep 17 00:00:00 2001 From: ShanYi-Hui Date: Wed, 26 Jun 2024 14:09:17 +0800 Subject: [PATCH] =?UTF-8?q?build(ui):=20:package:=20=E6=96=B0=E5=A2=9EVITE?= =?UTF-8?q?=5FHIDE=5FGLOBAL=5FSETTING=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=85=A8=E5=B1=80=E8=AE=BE=E7=BD=AE=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.base | 5 ++++- .env.dev | 5 ++++- .env.gitee | 5 ++++- .env.github | 5 ++++- .env.pro | 5 ++++- .env.test | 5 ++++- src/layout/Layout.vue | 4 +++- 7 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.env.base b/.env.base index 874b8fbc..c82a34ee 100644 --- a/.env.base +++ b/.env.base @@ -20,4 +20,7 @@ VITE_USE_ALL_ELEMENT_PLUS_STYLE=true VITE_USE_MOCK=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false \ No newline at end of file diff --git a/.env.dev b/.env.dev index 98de7025..3e022c74 100644 --- a/.env.dev +++ b/.env.dev @@ -38,4 +38,7 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false \ No newline at end of file diff --git a/.env.gitee b/.env.gitee index 3d43b8ce..b656bc0e 100644 --- a/.env.gitee +++ b/.env.gitee @@ -38,4 +38,7 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false \ No newline at end of file diff --git a/.env.github b/.env.github index 4191555b..05bb5dc5 100644 --- a/.env.github +++ b/.env.github @@ -38,4 +38,7 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false \ No newline at end of file diff --git a/.env.pro b/.env.pro index 5b4f15a4..5c03a0ed 100644 --- a/.env.pro +++ b/.env.pro @@ -38,4 +38,7 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false \ No newline at end of file diff --git a/.env.test b/.env.test index ff68f71f..bb12ef16 100644 --- a/.env.test +++ b/.env.test @@ -38,4 +38,7 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=false # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true + +# 是否隐藏全局设置按钮 +VITE_HIDE_GLOBAL_SETTING=false \ No newline at end of file diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue index dfcac776..1dfad7b5 100644 --- a/src/layout/Layout.vue +++ b/src/layout/Layout.vue @@ -15,6 +15,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) } @@ -58,7 +60,7 @@ export default defineComponent({ - + {!unref(hideSetting) && } ) }