生态产品多个设计器现已发布候选版本

查看生态总览
Skip to content

Watermark ​

General component. This page is the API reference, generated from the source code. Usage guidance and live examples are on the Chinese page.

Anatomy ​

Parts in bold are required.

data-scope="watermark": root · content

API reference ​

Descriptions of individual props, events and slots are written in Chinese and appear on the Chinese page.

Artifacts ​

LayerValue
Custom element<xh-watermark>
Vue componentsXhWatermarkContent XhWatermarkRoot
State machinewatermarkMachine
Skin@xihan-ui/styles/watermark.css

Props ​

PropTypeRequired
fontFamilystring
fontSizenumber
fullscreenboolean
gapnumber
imagestring
imageSizeWatermarkImageSize
opacitynumber
rotatenumber
textstring | string[]

State ​

The following names are internal to the state machine.

States: idle

Events: IMAGE.LOADED · IMAGE.CLEAR

connect API ​

getXxxProps() returns the host attributes of the matching part.

MemberType
linesreadonly string[]
tileWatermarkTile
imagestring
stateWatermarkState
fullscreenboolean
getRootProps() => T['element']
getContentProps() => T['element']

Accessibility ​

Keyboard ​

Specification: W3C APG. Each row is a stable behavior id that the conformance tests cover; the conditions and effects are described on the Chinese page.

No keyboard interaction: the component takes no focus, or focus behavior comes entirely from native elements.

Style reference ​

Skin ​

@xihan-ui/styles/watermark.css is written against [data-scope="watermark"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-watermark in place of data-scope (same specificity) and sits in the xihan.components layer. Put overrides in xihan.overrides; the part selectors work as usual.

CSS variables ​

The public override slots, generated from what the standalone skin actually consumes.

VariablePartCSS propertyStateDefault from
--xh-watermark-fgrootbackground-colorstate=ready--xh-fg-muted
--xh-watermark-imageroot-webkit-mask-image
mask-image
state=readynone
--xh-watermark-layerrootz-indexfullscreen
state=ready
--xh-layer-tooltip
--xh-watermark-tileroot-webkit-mask-size
mask-size
state=readyauto

Released under The MIT License