@@ -4,6 +4,7 @@ import { getStyleStr, getPixelRatio, rotateWatermark, reRendering } from './util
4
4
import { arrayType , objectType , someType , withInstall } from '../_util/type' ;
5
5
import { useMutationObserver } from '../_util/hooks/_vueuse/useMutationObserver' ;
6
6
import { initDefaultProps } from '../_util/props-util' ;
7
+ import { useToken } from '../theme/internal' ;
7
8
8
9
/**
9
10
* Base size of the canvas, 1 for parallel layout and 2 for alternate layout
@@ -42,6 +43,7 @@ const Watermark = defineComponent({
42
43
gap : [ 100 , 100 ] ,
43
44
} ) ,
44
45
setup ( props , { slots, attrs } ) {
46
+ const [ , token ] = useToken ( ) ;
45
47
const containerRef = shallowRef < HTMLDivElement > ( ) ;
46
48
const watermarkRef = shallowRef < HTMLDivElement > ( ) ;
47
49
const stopObservation = shallowRef ( false ) ;
@@ -51,11 +53,11 @@ const Watermark = defineComponent({
51
53
const gapYCenter = computed ( ( ) => gapY . value / 2 ) ;
52
54
const offsetLeft = computed ( ( ) => props . offset ?. [ 0 ] ?? gapXCenter . value ) ;
53
55
const offsetTop = computed ( ( ) => props . offset ?. [ 1 ] ?? gapYCenter . value ) ;
54
- const fontSize = computed ( ( ) => props . font ?. fontSize ?? 16 ) ;
56
+ const fontSize = computed ( ( ) => props . font ?. fontSize ?? token . value . fontSizeLG ) ;
55
57
const fontWeight = computed ( ( ) => props . font ?. fontWeight ?? 'normal' ) ;
56
58
const fontStyle = computed ( ( ) => props . font ?. fontStyle ?? 'normal' ) ;
57
59
const fontFamily = computed ( ( ) => props . font ?. fontFamily ?? 'sans-serif' ) ;
58
- const color = computed ( ( ) => props . font ?. color ?? 'rgba(0, 0, 0, 0.15)' ) ;
60
+ const color = computed ( ( ) => props . font ?. color ?? token . value . colorFill ) ;
59
61
const markStyle = computed ( ( ) => {
60
62
const markStyle : CSSProperties = {
61
63
zIndex : props . zIndex ?? 9 ,
@@ -210,7 +212,7 @@ const Watermark = defineComponent({
210
212
renderWatermark ( ) ;
211
213
} ) ;
212
214
watch (
213
- ( ) => props ,
215
+ ( ) => [ props , token . value . colorFill , token . value . fontSizeLG ] ,
214
216
( ) => {
215
217
renderWatermark ( ) ;
216
218
} ,
0 commit comments