docs/en-US/component/watermark.md
Add specific text or patterns to the page.
The most basic usage.
:::demo
watermark/basic
:::
Use content to set an array of strings to specify multi-line text watermark content.
:::demo
watermark/multi-line
:::
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.
:::demo
watermark/image
:::
Preview the watermark effect by configuring custom parameters.
:::demo
watermark/custom
:::
| Name | Description | Type | Default |
|---|---|---|---|
| width | The width of the watermark, the default value of content is its own width | ^[number] | 120 |
| height | The height of the watermark, the default value of content is its own height | ^[number] | 64 |
| rotate | When the watermark is drawn, the rotation Angle, unit ° | ^[number] | -22 |
| z-index | The z-index of the appended watermark element | ^[number] | 9 |
| image | Image source, it is recommended to export 2x or 3x image, high priority | ^[string] | — |
| content | Watermark text content | ^[string]/^[array]string[] | Element Plus |
| font | Text style | Font | Font |
| gap | The spacing between watermarks | ^[array][number, number] | [100, 100] |
| offset | The offset of the watermark from the upper left corner of the container. The default is gap/2 | ^[array][number, number] | [gap[0]/2, gap[1]/2] |
| Name | Description | Type | Default |
|---|---|---|---|
| color | font color | ^[string] | rgba(0,0,0,.15) |
| fontSize | font size | ^[number] / ^[string] | 16 |
| fontWeight | font weight | ^[enum]'normal' | 'bold' | 'lighter' | 'bolder' | number | normal |
| fontFamily | font family | ^[string] | sans-serif |
| fontGap ^(2.11.5) | font gap | ^[number] | 3 |
| fontStyle | font style | ^[enum]'none' | 'normal' | 'italic' | 'oblique' | normal |
| textAlign | text align | ^[enum]'left' | 'right' | 'center' | 'start' | 'end' | center |
| textBaseline | text baseline | ^[enum]'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom' | hanging |
| Name | Description |
|---|---|
| default | container for adding watermark |