{"id":53283,"date":"2024-12-03T09:40:02","date_gmt":"2024-12-03T01:40:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53283\/"},"modified":"2024-12-03T09:40:02","modified_gmt":"2024-12-03T01:40:02","slug":"van-ui%e6%b0%b4%e5%8d%b0%e7%bb%84%e4%bb%b6%e6%97%8b%e8%bd%ac%e5%90%8e%e6%96%87%e5%ad%97%e8%a2%ab%e9%9a%90%e8%97%8f%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53283\/","title":{"rendered":"Van UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Van UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f <\/h1>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u4eec\u53c8\u89c1\u9762\u4e86\u554a~\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aVan UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f \u300b<\/span>\u7684\u5185\u5bb9\u4e2d\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u3002\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u77e5\u8bc6\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\uff0c\u4ee5\u540e\u4f1a\u7ed9\u5927\u5bb6\u5e26\u6765\u66f4\u591a<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u6587\u7ae0\uff0c\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u8fdb\u6b65\uff01\u4e0b\u9762\u5c31\u5f00\u59cb\u672c\u6587\u7684\u6b63\u5f0f\u5185\u5bb9~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241128\/17327977556748653b7ff52.jpg\" class=\"aligncenter\" title=\"Van UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"Van UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u524d\u7aef\u6c34\u5370\u7ec4\u4ef6\u7684\u65cb\u8f6c\u89d2\u5ea6\u5bf9\u6587\u5b57\u7684\u5f71\u54cd<\/strong><\/p>\n<p>\u95ee\u9898\u63cf\u8ff0\uff1a\u5728\u4f7f\u7528 van ui \u7ec4\u4ef6\u5e93\u7684\u6c34\u5370\u7ec4\u4ef6 &lt;van-watermark&gt; \u65f6\uff0c\u8bbe\u7f6e rotate \u5c5e\u6027\u540e\uff0c\u90e8\u5206\u6587\u5b57\u88ab\u9690\u85cf\u4e86\u3002<\/p>\n<p>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n<pre>&lt;van-watermark\n      v-if=\"watermessage\"\n      :full-page=\"isfull\"\n      :width=\"watermessage.length * 10\"\n      :rotate=\"isfull ? 65 : 0\"\n    &gt;\n      &lt;template #content&gt;\n        &lt;div :style=\"{\n          width: `${watermessage.length * 8}px`,\n          color: 'rgba(255,255,255, .2)',\n          fontsize: '12px'\n        }\"&gt;\n          &lt;p&gt;{{ watermessage }}&lt;\/p&gt;\n        &lt;\/div&gt;\n      &lt;\/template&gt;\n    &lt;\/van-watermark&gt;<\/pre>\n<p>\u539f\u56e0\u5206\u6790\uff1a<\/p>\n<p>\u5f53 isfull \u4e3a true \u65f6\uff0c\u6c34\u5370\u7ec4\u4ef6\u5c06\u65cb\u8f6c\u4e00\u5b9a\u89d2\u5ea6\uff08\u672c\u4f8b\u4e3a65\u5ea6\uff09\u3002\u6b64\u65f6\uff0c\u6c34\u5370\u6587\u5b57\u53ef\u80fd\u4f1a\u88ab\u7ec4\u4ef6\u672c\u8eab\u6216\u5176\u4ed6\u5143\u7d20\u906e\u6321\u4f4f\uff0c\u5bfc\u81f4\u90e8\u5206\u6587\u5b57\u9690\u85cf\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p><strong>1. \u8bbe\u7f6e z-index<\/strong><\/p>\n<p>\u5c06\u6c34\u5370\u7ec4\u4ef6\u7684 z-index \u8bbe\u7f6e\u4e3a\u9ad8\u4e8e\u5176\u4ed6\u5143\u7d20\uff0c\u786e\u4fdd\u5b83\u4e0d\u4f1a\u88ab\u906e\u6321\u3002<\/p>\n<pre>.van-watermark {\n  z-index: 999;\n}<\/pre>\n<p><strong>2. \u590d\u5236\u6c34\u5370<\/strong><\/p>\n<p>\u590d\u5236\u4e00\u4efd\u6c34\u5370\u7ec4\u4ef6\uff0c\u4e00\u4efd\u7528\u4f5c\u65cb\u8f6c\u663e\u793a\uff0c\u53e6\u4e00\u4efd\u7528\u4e8e\u56fa\u5b9a\u663e\u793a\u3002<\/p>\n<pre>&lt;div v-if=\"waterMessage\"&gt;\n  &lt;van-watermark\n    :rotate=\"isFull ? 65 : 0\"\n    :style=\"{\n      pointer-events: 'none',\n      opacity: '0.2'\n    }\"\n  &gt;\n    &lt;!-- \u65cb\u8f6c\u663e\u793a\u7684\u6c34\u5370\u5185\u5bb9 --&gt;\n  &lt;\/van-watermark&gt;\n  &lt;van-watermark&gt;\n    &lt;!-- \u56fa\u5b9a\u663e\u793a\u7684\u6c34\u5370\u5185\u5bb9 --&gt;\n  &lt;\/van-watermark&gt;\n&lt;\/div&gt;<\/pre>\n<p>\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300aVan UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f \u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~\u7c73\u4e91\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03\u6587\u7ae0\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   Go\u8bed\u8a00\u4e2d\uff0c\u4e3a\u4ec0\u4e48\u65e0\u6cd5\u5bfc\u5165\u5305\u4e2d\u7684\u51fd\u6570\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Van UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f \u5927\u5bb6\u597d\uff0c\u6211\u4eec\u53c8\u89c1\u9762\u4e86\u554a~\u672c\u6587\u300aVan UI\u6c34\u5370\u7ec4\u4ef6\u65cb\u8f6c\u540e\u6587\u5b57\u88ab\u9690\u85cf\uff0c\u5982\u4f55\u89e3\u51b3\uff1f \u300b\u7684\u5185\u5bb9\u4e2d\u5c06\u4f1a\u6d89\u53ca\u5230\u7b49\u7b49\u3002\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u77e5\u8bc6\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\uff0c\u4ee5\u540e\u4f1a\u7ed9\u5927\u5bb6\u5e26\u6765\u66f4\u591a\u6587\u7ae0\u76f8\u5173\u6587\u7ae0\uff0c\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u8fdb\u6b65\uff01\u4e0b\u9762\u5c31\u5f00\u59cb\u672c\u6587\u7684\u6b63\u5f0f\u5185\u5bb9~ \u524d\u7aef\u6c34\u5370\u7ec4\u4ef6\u7684\u65cb\u8f6c\u89d2\u5ea6\u5bf9\u6587\u5b57\u7684\u5f71\u54cd \u95ee\u9898\u63cf\u8ff0\uff1a\u5728\u4f7f\u7528 van ui \u7ec4\u4ef6\u5e93\u7684\u6c34\u5370\u7ec4\u4ef6 &lt;van-watermark&gt; \u65f6\uff0c\u8bbe\u7f6e rotate \u5c5e\u6027\u540e\uff0c\u90e8\u5206\u6587\u5b57\u88ab\u9690\u85cf\u4e86\u3002 \u4ee3\u7801\u793a\u4f8b\uff1a &lt;van-watermark v-if=&#8221;watermessage&#8221; :full-page=&#8221;isfull&#8221; :width=&#8221;watermessage.length * 10&#8243; :rotate=&#8221;isfull ? 65 : 0&#8243; &gt; &lt;template #content&gt; &lt;div :style=&#8221;{ width: `${watermessage.length * 8}px`, color: &#8216;rgba(255,255,255, .2)&#8217;, fontsize: &#8217;12px&#8217; }&#8221;&gt; &lt;p&gt;{{ watermessage }}&lt;\/p&gt; &lt;\/div&gt; &lt;\/template&gt; &lt;\/van-watermark&gt; \u539f\u56e0\u5206\u6790\uff1a \u5f53 isfull \u4e3a true \u65f6\uff0c\u6c34\u5370\u7ec4\u4ef6\u5c06\u65cb\u8f6c\u4e00\u5b9a\u89d2\u5ea6\uff08\u672c\u4f8b\u4e3a65\u5ea6\uff09\u3002\u6b64\u65f6\uff0c\u6c34\u5370\u6587\u5b57\u53ef\u80fd\u4f1a\u88ab\u7ec4\u4ef6\u672c\u8eab\u6216\u5176\u4ed6\u5143\u7d20\u906e\u6321\u4f4f\uff0c\u5bfc\u81f4\u90e8\u5206\u6587\u5b57\u9690\u85cf\u3002 \u89e3\u51b3\u65b9\u6848\uff1a 1. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-53283","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53283"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53283\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}