/*! For license information please see 545.bb452477.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["545"],{92410:function(n,s,a){"use strict";a.r(s);var t=a("80681");let d=["innerHTML"];s.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

Watermark \u6C34\u5370

\n

\u4ECB\u7ECD

\n

\u5728\u9875\u9762\u4E0A\u6DFB\u52A0\u7279\u5B9A\u7684\u6587\u5B57\u6216\u56FE\u6848\u4F5C\u4E3A\u6C34\u5370\uFF0C\u53EF\u7528\u4E8E\u9632\u6B62\u4FE1\u606F\u76D7\u7528\u3002\u8BF7\u5347\u7EA7 vant \u5230 >= 4.2.0 \u7248\u672C\u6765\u4F7F\u7528\u8BE5\u7EC4\u4EF6\u3002

\n

\u5F15\u5165

\n

\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003\u7EC4\u4EF6\u6CE8\u518C\u3002

\n
import { createApp } from 'vue';\nimport { Watermark } from 'vant';\n\nconst app = createApp();\napp.use(Watermark);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u6587\u5B57\u6C34\u5370

\n

\u901A\u8FC7 content \u5C5E\u6027\u6765\u8BBE\u7F6E\u6C34\u5370\u7684\u6587\u5B57\u3002

\n
<van-watermark content="Vant" />\n
\n

\u56FE\u7247\u6C34\u5370

\n

\u901A\u8FC7 image \u5C5E\u6027\u6765\u8BBE\u7F6E\u6C34\u5370\u56FE\u7247\uFF0C\u5E76\u4F7F\u7528 opacity \u6765\u8C03\u6574\u6C34\u5370\u7684\u6574\u4F53\u900F\u660E\u5EA6\u3002

\n
<van-watermark\n  image="https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png"\n  opacity="0.2"\n/>\n
\n

\u81EA\u5B9A\u4E49\u95F4\u9694

\n

\u901A\u8FC7 gap-x \u548C gap-y \u5C5E\u6027\u6765\u63A7\u5236\u591A\u4E2A\u91CD\u590D\u6C34\u5370\u4E4B\u95F4\u7684\u95F4\u9694\u3002

\n
<van-watermark\n  image="https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png"\n  :gap-x="30"\n  :gap-y="10"\n  opacity="0.2"\n/>\n
\n

\u81EA\u5B9A\u4E49\u503E\u659C\u89D2\u5EA6

\n

\u901A\u8FC7 rotate \u5C5E\u6027\u6765\u63A7\u5236\u6C34\u5370\u7684\u503E\u659C\u89D2\u5EA6\uFF0C\u9ED8\u8BA4\u503C\u4E3A-22\u3002

\n
<van-watermark\n  image="https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png"\n  rotate="22"\n  opacity="0.2"\n/>\n
\n

\u663E\u793A\u8303\u56F4

\n

\u901A\u8FC7 full-page \u5C5E\u6027\u6765\u63A7\u5236\u6C34\u5370\u7684\u663E\u793A\u8303\u56F4\u3002

\n
<van-watermark\n  image="https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png"\n  opacity="0.2"\n  :full-page="true"\n/>\n
\n

HTML \u6C34\u5370

\n

\u901A\u8FC7 content \u63D2\u69FD\u53EF\u4EE5\u76F4\u63A5\u4F20\u5165 HTML \u4F5C\u4E3A\u6C34\u5370\u3002HTML \u4E2D\u7684\u6837\u5F0F\u4EC5\u652F\u6301\u884C\u5185\u6837\u5F0F\uFF0C\u540C\u65F6\u4E0D\u652F\u6301\u4F20\u5165\u81EA\u95ED\u5408\u6807\u7B7E\u3002

\n
<van-watermark :width="150">\n  <template #content>\n    <div style="background: linear-gradient(45deg, #000 0, #000 50%, #fff 50%)">\n      <p style="mix-blend-mode: difference; color: #fff">Vant watermark</p>\n    </div>\n  </template>\n</van-watermark>\n
\n

API

\n

Props

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
width\u6C34\u5370\u5BBD\u5EA6number100
height\u6C34\u5370\u9AD8\u5EA6number100
z-index\u6C34\u5370\u7684 z-indexnumber | string100
content\u6587\u5B57\u6C34\u5370\u7684\u5185\u5BB9string-
image\u56FE\u7247\u6C34\u5370\u7684\u5185\u5BB9\uFF0C\u5982\u679C\u4E0E content \u540C\u65F6\u4F20\u5165\uFF0C\u4F18\u5148\u4F7F\u7528\u56FE\u7247\u6C34\u5370string-
rotate\u6C34\u5370\u7684\u65CB\u8F6C\u89D2\u5EA6number | string-22
full-page\u6C34\u5370\u662F\u5426\u5168\u5C4F\u663E\u793Abooleanfalse
gap-x\u6C34\u5370\u4E4B\u95F4\u7684\u6C34\u5E73\u95F4\u9694number0
gap-y\u6C34\u5370\u4E4B\u95F4\u7684\u5782\u76F4\u95F4\u9694number0
text-color\u6587\u5B57\u6C34\u5370\u7684\u989C\u8272string#dcdee0
opacity\u6C34\u5370\u7684\u900F\u660E\u5EA6number | string-
\n

Slots

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u8BF4\u660E
contentHTML \u6C34\u5370\u7684\u5185\u5BB9\uFF0C\u4EC5\u652F\u6301\u884C\u5185\u6837\u5F0F\uFF0C\u540C\u65F6\u4E0D\u652F\u6301\u4F20\u5165\u81EA\u95ED\u5408\u6807\u7B7E\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E content \u6216 image \u5C5E\u6027
\n

\u7C7B\u578B\u5B9A\u4E49

\n

\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A

\n
import type { WaterProps } from 'vant';\n
\n

\u4E3B\u9898\u5B9A\u5236

\n

\u6837\u5F0F\u53D8\u91CF

\n

\u7EC4\u4EF6\u63D0\u4F9B\u4E86\u4E0B\u5217 CSS \u53D8\u91CF\uFF0C\u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49\u6837\u5F0F\uFF0C\u4F7F\u7528\u65B9\u6CD5\u8BF7\u53C2\u8003 ConfigProvider \u7EC4\u4EF6\u3002

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-watermark-z-index100\u6839\u8282\u70B9\u7684 z-index \u5C42\u7EA7
\n
'},null,8,d))}}}]);