From 21bccd866d249d7f5c7f0e031b8b622714de0680 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期五, 23 五月 2025 16:54:50 +0800
Subject: [PATCH] 数据联调
---
src/layout/components/Sidebar/Logo.vue | 36 +++++++++++++++++++++++++++---------
1 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index 962600e..90146ae 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -1,22 +1,22 @@
<template>
- <div class="sidebar-logo-container" :class="{ 'collapse': collapse }" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
+ <div class="sidebar-logo-container" :class="{ 'collapse': collapse }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
- <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
+ <h1 v-else class="sidebar-title">{{ title }}</h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
- <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
+ <h1 class="sidebar-title">{{ title }}</h1>
</router-link>
</transition>
</div>
</template>
<script setup>
-import variables from '@/assets/styles/variables.module.scss'
import logo from '@/assets/logo/logo.png'
import useSettingsStore from '@/store/modules/settings'
+import variables from '@/assets/styles/variables.module.scss'
defineProps({
collapse: {
@@ -25,12 +25,30 @@
}
})
-const title = ref('鑻ヤ緷绠$悊绯荤粺');
-const settingsStore = useSettingsStore();
-const sideTheme = computed(() => settingsStore.sideTheme);
+const title = import.meta.env.VITE_APP_TITLE
+const settingsStore = useSettingsStore()
+const sideTheme = computed(() => settingsStore.sideTheme)
+
+// 鑾峰彇Logo鑳屾櫙鑹�
+const getLogoBackground = computed(() => {
+ if (settingsStore.isDark) {
+ return 'var(--sidebar-bg)'
+ }
+ return sideTheme.value === 'theme-dark' ? variables.menuBg : variables.menuLightBg
+})
+
+// 鑾峰彇Logo鏂囧瓧棰滆壊
+const getLogoTextColor = computed(() => {
+ if (settingsStore.isDark) {
+ return 'var(--sidebar-text)'
+ }
+ return sideTheme.value === 'theme-dark' ? '#fff' : variables.menuLightText
+})
</script>
<style lang="scss" scoped>
+@import '@/assets/styles/variables.module.scss';
+
.sidebarLogoFade-enter-active {
transition: opacity 1.5s;
}
@@ -45,7 +63,7 @@
width: 100%;
height: 50px;
line-height: 50px;
- background: #2b2f3a;
+ background: v-bind(getLogoBackground);
text-align: center;
overflow: hidden;
@@ -63,7 +81,7 @@
& .sidebar-title {
display: inline-block;
margin: 0;
- color: #fff;
+ color: v-bind(getLogoTextColor);
font-weight: 600;
line-height: 50px;
font-size: 14px;
--
Gitblit v1.9.3