Skip to content

Watermark ​

Watermark: a tiled layer over the protected content (pointer-events: none, not selectable). Text and image modes.

Platform differences (registered): this port uses a uniform CSS grid tiling (no canvas tile on H5 or mini-program); cell layout comes from the share-core layoutWatermarkCells pure function.

Basic usage ​

vue
<template>
  <lh-watermark content="lh-ui 家族" :font-size="16" :gap-x="120">
    <view class="content">
      <text>受保护的内容</text>
    </view>
  </lh-watermark>
</template>

Image watermark & fullscreen ​

image takes precedence over content; fullscreen covers the viewport (fixed):

vue
<lh-watermark image="/logo.png" :opacity="0.2" fullscreen />

Prop ​

PropDescriptionTypeDefault
contentstringstring—
imagestringstring—
opacitynumbernumber0.15
rotatenumbernumber-22
gapXnumbernumber100
gapYnumbernumber—
fontSizenumbernumber14
fontColorstringstring—
zIndexnumbernumber100
fullscreenbooleanbooleanfalse
disabledbooleanbooleanfalse
customClassstringstring—
sxLhSxPropsLhSxProps—

Slot ​

Slot
default