Skip to content

Watermark ​

Add specified images or text on pages or components, which can be used for copyright protection, brand promotion, and other scenarios.

Basic Usage ​

Place the WaterMark component in the page, you can set the watermark display content through the content field, and set the height and width of a single watermark through width and height to display a full-screen watermark.

html
<wd-watermark content="wot-design-uni" :width="130" :height="130"></wd-watermark>

Image Watermark ​

Set the network image address or Base64 image through the image field, and set the width and height of the watermark image through the image-width and image-height fields. Note: DingTalk Mini Program platform only supports network images.

html
<wd-watermark image="https://v1.wot-ui.cn/logo.png" :image-width="38" :image-height="38"></wd-watermark>

Local Watermark ​

Set whether it is a full-screen watermark through full-screen.

html
<wd-watermark content="wot-design-uni" :full-screen="false"></wd-watermark>

Custom Layer Level and Opacity ​

Set opacity through opacity and watermark layer level through z-index.

html
<wd-watermark content="wot-design-uni" :opacity="0.4"></wd-watermark>

Attributes ​

ParameterDescriptionTypeAccepted ValuesDefaultVersion
contentDisplay contentstring-''0.1.16
imageImage address, supports network images and base64 (DingTalk Mini Program supports network images)string-''0.1.16
imageHeightImage heightnumber-1000.1.16
imageWidthImage widthnumber-1000.1.16
gutterXX-axis spacing, unit pxnumber-00.1.16
gutterYY-axis spacing, unit pxnumber-00.1.16
widthCanvas width, unit pxnumber-1000.1.16
heightCanvas height, unit pxnumber-1000.1.16
fullScreenWhether it is a full-screen watermarkboolean-true0.1.16
colorWatermark font colorstring-'#8c8c8c'0.1.16
sizeWatermark font size, unit pxnumber-140.1.16
fontStyleWatermark font style (only supported by WeChat, Alipay and H5)stringnormal / italic / oblique'normal'0.1.16
fontWeightWatermark font weight (only supported by WeChat, Alipay and H5)stringnormal / bold / bolder'normal'0.1.16
fontFamilyWatermark font family (only supported by WeChat, Alipay and H5)string-'PingFang SC'0.1.16
rotateWatermark rotation anglenumber--250.1.16
zIndexCustom layer levelnumber-11000.1.16
opacityCustom opacity, value range 0~1number-0.50.1.16

Source Code ​

Documentation
• Component

Released under the MIT License.

Released under the MIT License.