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

This commit is contained in:
郝先瑞 2024-02-23 10:01:12 +08:00
parent 9335ec1647
commit 68b76b82cf
1 changed files with 12 additions and 4 deletions

View File

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