给页面的某个区域加上水印
import { watermark } from '@aplus-frontend/watermark'
watermark({
content: 'aplus 水印',
isShow: true,
})
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
container | 承载水印的父容器 | HTMLElement | body |
isShow | 水印是否加载 | boolean | true |
width | 水印的宽度 | string | 300px |
height | 水印的高度 | string | 200px |
textAlign | 文本对其方式 | "start" or "end" or "center" or "left" or "right" | center |
textBaseline | 文本对其方式 | "alphabetic" or "top" or "hanging" or "middle" or "ideographic" or "bottom" | middle |
font | 文字样式 | string | rgba20px Microsoft Yahei |
fillStyle | 文字的颜色 | string | rgba(191, 191, 191, 0.15) |
content | 填充文本 | string | 水印 |
content | 水印文本旋转的角度 | number | 30 |
zIndex | 水印的高度 | number | 10000 |
- init 水印挂载
- setOption 修改配置项
- destroy 卸载水印