# Watermark 水印 V2.2.11
给页面的某个区域加上水印。
# 代码演示
# API
# Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 | Version |
---|---|---|---|---|---|
width | 水印的宽度, content 的默认值是它自己的宽度 | Number | 120 | ||
height | 水印的高度, content 的默认值是它自己的高度 | Number | 64 | ||
rotate | 水印的旋转角度, 单位 ° | Number | -22 | ||
zIndex | 水印元素的 z-index 值 | Number | 9 | ||
image | 水印图片,建议使用 2x 或 3x 图像 | String | - | ||
content | 水印文本内容 | String/Array | - | ||
font | 文字样式 | Font | Font | ||
gap | 水印之间的间距 | Array | [100, 100] | ||
offset | 水印从容器左上角的偏移 默认值为 gap/2 | Array | [gap[0]/2, gap[1]/2] |
# Font
参数 | 说明 | 类型 | 可选值 | 默认值 | Version |
---|---|---|---|---|---|
color | 字体颜色 | String | rgba(0,0,0,.16) | ||
fontSize | 字体大小 | Number | 18 | ||
fontWeight | 自重 | 'normal' | 'light' | 'weight' | Number` | normal | ||
fontFamily | 字体 | String | sans-serif | ||
fontStyle | 字体样式 | 'none' | 'normal' | 'italic' | 'oblique'` | normal | ||
textAlign | 文本对齐 | 'left' | 'right' | 'center'| 'start' | 'end'` | center | ||
textBaseline | 文本基线 | 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom'` | top |