fix(App.vue): 🐛 水印字体颜色未适配暗黑主题导致无法显示问题修复

This commit is contained in:
郝先瑞
2024-02-23 10:01:12 +08:00
parent 9335ec1647
commit 68b76b82cf

View File

@@ -3,7 +3,8 @@
<!-- 开启水印 --> <!-- 开启水印 -->
<el-watermark <el-watermark
v-if="watermarkEnabled" v-if="watermarkEnabled"
:content="watermarkContent" :font="{ color: fontColor }"
:content="defaultSettings.watermarkContent"
class="wh-full" class="wh-full"
> >
<router-view /> <router-view />
@@ -16,12 +17,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { useAppStore, useSettingsStore } from "@/store"; import { useAppStore, useSettingsStore } from "@/store";
import defaultSettings from "@/settings"; import defaultSettings from "@/settings";
import { ThemeEnum } from "@/enums/ThemeEnum";
const appStore = useAppStore(); const appStore = useAppStore();
const settingsStore = useSettingsStore();
const locale = computed(() => appStore.locale); const locale = computed(() => appStore.locale);
const size = computed(() => appStore.size); const size = computed(() => appStore.size);
const watermarkContent = defaultSettings.watermarkContent;
const settingsStore = useSettingsStore();
const watermarkEnabled = computed(() => settingsStore.watermarkEnabled); const watermarkEnabled = computed(() => settingsStore.watermarkEnabled);
// 明亮/暗黑主题水印字体颜色适配
const fontColor = computed(() => {
return settingsStore.theme === ThemeEnum.DARK
? "rgba(255, 255, 255, .15)"
: "rgba(0, 0, 0, .15)";
});
</script> </script>