docs(components): [watermark] improve text color readability in dark (#23721)

This commit is contained in:
rzzf
2026-03-04 10:51:28 +08:00
committed by GitHub
parent 17627647e3
commit 25a3595ede

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { reactive, watch } from 'vue'
import { isDark } from '~/composables/dark'
const config = reactive({
content: 'Element Plus',
@@ -12,6 +13,16 @@ const config = reactive({
gap: [100, 100] as [number, number],
offset: [] as unknown as [number, number],
})
watch(
isDark,
(value) => {
config.font.color = value
? 'rgba(255, 255, 255, .15)'
: 'rgba(0, 0, 0, .15)'
},
{ immediate: true }
)
</script>
<template>