1.0.3 • Published 3 years ago

watermarkall v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

npm.io

Install

npm install watermarkall

Usage

Watermarking a web

import WM from 'watermarkall';

const options = {
  content: 'Hello, Watermarkall!'
}

// add watermark
// vue项目中使用应放在mounted勾子中
// react项目中使用应放在ComponentDidMount勾子中
const webWm = new WM.WebWatermark(element); // element is optional, it will mark under the root element if omitted
webWm.addWm(options)

// remove watermark
webWm.removeWm();

Attributes

AttributeDescriptionCompulsoryTypeDefault
elementelement under which to add watermarkNoHTMLelementdocument.documentElement
optionsoptions to configure watermarkNoobjectsee the options table

Items for options

nameDescriptionCompulsoryTypeDefault
widthwatermark widthNostring300px
heightwatermark heightNostring200px
textAlignwatermark alignmentNostringcenter
textBaselinewatermark text base lineNostringmiddle
fontwatermark text fontNostring20px Microsoft Yahei
fillStylewatermark text colorNostringrgb(153,153,153, 0.2)
contentwatermark contentNostringWatermarker-All
rotatewatermark rotationNostring30
zIndexwatermark zIndexNonumber9999

License

MIT

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago