@aplus-frontend/watermark
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Watermark 水印

给页面的某个区域加上水印

基本使用

import { watermark } from '@aplus-frontend/watermark'
watermark({
  content: 'aplus 水印',
  isShow: true,
})

Props

参数 说明 类型 默认值
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 卸载水印

Readme

Keywords

none

Package Sidebar

Install

npm i @aplus-frontend/watermark

Weekly Downloads

6

Version

0.1.1

License

Apache-2.0

Unpacked Size

23.1 kB

Total Files

5

Last publish

Collaborators

  • alanreumy
  • lonelyfkinging
  • huimin2000
  • hemuxue
  • kuguago
  • orange1992
  • zxlin429
  • huaz
  • rainiexxx
  • asd517665931
  • limoer
  • ollieliu