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 } }