Watermark

Add specific text or patterns to the page.

Basic usage

The most basic usage

Multi-line watermark

Use "content" to set an array of strings to specify multi-line text watermark content.

Image watermark

Specify the image address via 'image'. To ensure that the image is high definition and not stretched, set the width and height, and upload at least twice the width and height of the logo image address.

Custom configuration

Preview the watermark effect by configuring custom parameters.

Element Plus

A Vue 3 based component library for designers and developers

示例图片
Content
Color
FontSize
zIndex
Rotate
Gap
Offset

API

Attributes

NameDescriptionTypeDefault
widthThe width of the watermark, the default value of content is its own widthnumber120
heightThe height of the watermark, the default value of content is its own heightnumber64
rotateWhen the watermark is drawn, the rotation Angle, unit °number-22
zIndexThe z-index of the appended watermark elementnumber9
imageImage source, it is recommended to export 2x or 3x image, high prioritystring
contentWatermark text contentstring/object
fontText styleFontFont
gapThe spacing between watermarksobject[100, 100]
offsetThe offset of the watermark from the upper left corner of the container. The default is gap/2object[gap[0]/2, gap[1]/2]

Font

NameDescriptionTypeDefault
colorfont colorstringrgba(0,0,0,.15)
fontSizefont sizenumber16
fontWeightfont weightenumnormal
fontFamilyfont familystringsans-serif
fontStylefont styleenumnormal
textAligntext alignenumcenter
textBaselinetext baselineenumhanging

Slots

NameDescription
defaultcontainer for adding watermark

Source

ComponentDocs

Contributors