{"id":53118,"date":"2024-12-03T15:40:37","date_gmt":"2024-12-03T07:40:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53118\/"},"modified":"2024-12-03T15:40:37","modified_gmt":"2024-12-03T07:40:37","slug":"element-ui-%e8%a1%a8%e5%8d%95-label-%e6%a0%87%e7%ad%be%e4%b8%ba%e4%bd%95%e5%87%ba%e7%8e%b0%e5%9c%a8%e4%b8%8a%e6%96%b9%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53118\/","title":{"rendered":"Element UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Element UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f<\/h1>\n<p>\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u52aa\u529b\u5b66\u4e60\u5427\uff01\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aElement UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f\u300b<\/span>\u4e3b\u8981\u8bb2\u89e3\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6211\u4f1a\u5728\u7c73\u4e91\u4e2d\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u7684\u7cfb\u5217\u6587\u7ae0\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u5e76\u79ef\u6781\u7559\u8a00\u5efa\u8bae\u3002\u4e0b\u9762\u5c31\u5148\u4e00\u8d77\u6765\u770b\u4e00\u4e0b\u672c\u7bc7\u6b63\u6587\u5185\u5bb9\u5427\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u4f60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/17326305516745d817c0eed.jpg\" class=\"aligncenter\" title=\"Element UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f\u63d2\u56fe\" alt=\"Element UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>element-label\u6807\u7b7e\u91cc\u7684\u6587\u5b57\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f<\/strong><\/p>\n<p>\u60a8\u63d0\u4f9b\u7684\u4ee3\u7801\u4e2d\uff0c\u90e8\u5206\u8868\u5355\u9879\u7684label\u6807\u7b7e\u91cc\u7684\u6587\u5b57\u51fa\u73b0\u5728\u8f93\u5165\u6846\u4e0a\u65b9\u3002\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86el-form\u7ec4\u4ef6\u7684label-width\u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u63a7\u5236label\u6807\u7b7e\u7684\u5bbd\u5ea6\u3002<\/p>\n<p><strong>\u5b98\u7f51\u793a\u4f8b\u4e2d\u7684label\u6807\u7b7e\u5728\u5de6\u8fb9<\/strong><\/p>\n<p>\u5728element ui\u7684\u5b98\u65b9\u6587\u6863\u4e2d\u5c55\u793a\u7684\u8868\u5355\u9879label\u6807\u7b7e\u90fd\u5728\u8f93\u5165\u6846\u5de6\u8fb9\uff0c\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>&lt;el-form label-position=\"top\"&gt;\n  ...\n&lt;\/el-form&gt;<\/pre>\n<p>label-position\u5c5e\u6027\u6307\u5b9alabel\u6807\u7b7e\u7684\u4f4d\u7f6e\uff0c&#8221;top&#8221;\u8868\u793a\u5728\u8f93\u5165\u6846\u4e0a\u65b9\uff0c&#8221;right&#8221;\u8868\u793a\u5728\u8f93\u5165\u6846\u53f3\u8fb9\uff0c\u9ed8\u8ba4\u503c\u4e3a&#8221;left&#8221;\u8868\u793a\u5728\u8f93\u5165\u6846\u5de6\u8fb9\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a\u8c03\u6574label-width\u548clabel-position\u5c5e\u6027<\/strong><\/p>\n<p>\u8981\u5c06label\u6807\u7b7e\u79fb\u52a8\u5230\u8f93\u5165\u6846\u5de6\u8fb9\uff0c\u53ef\u4ee5\u8c03\u6574label-width\u548clabel-position\u5c5e\u6027\uff1a<\/p>\n<pre>&lt;el-form label-width=\"auto\" label-position=\"left\"&gt;\n  ...\n&lt;\/el-form&gt;<\/pre>\n<ul>\n<li>label-width=&#8221;auto&#8221;\u5141\u8bb8label\u6807\u7b7e\u81ea\u52a8\u8c03\u6574\u5bbd\u5ea6\u4ee5\u9002\u5e94\u5176\u5185\u5bb9\u3002<\/li>\n<li>label-position=&#8221;left&#8221;\u5c06label\u6807\u7b7e\u653e\u5728\u8f93\u5165\u6846\u5de6\u8fb9\u3002<\/li>\n<\/ul>\n<p>\u8c03\u6574\u540e\uff0clabel\u6807\u7b7e\u5c06\u51fa\u73b0\u5728\u8f93\u5165\u6846\u7684\u5de6\u8fb9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p>[\u56fe\u7247]<\/p>\n<p>\u4eca\u5929\u5173\u4e8e\u300aElement UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u7c73\u4e91\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u6280\u5609z77\u4e3b\u677f\u652f\u6301Win11\u5417 z77\u4e3b\u677f\u662f\u5426\u652f\u6301Win11\u8be6\u7ec6\u4ecb\u7ecd\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Element UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f \u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u52aa\u529b\u5b66\u4e60\u5427\uff01\u672c\u6587\u300aElement UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f\u300b\u4e3b\u8981\u8bb2\u89e3\u4e86\u7b49\u7b49\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6211\u4f1a\u5728\u7c73\u4e91\u4e2d\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u7684\u7cfb\u5217\u6587\u7ae0\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u5e76\u79ef\u6781\u7559\u8a00\u5efa\u8bae\u3002\u4e0b\u9762\u5c31\u5148\u4e00\u8d77\u6765\u770b\u4e00\u4e0b\u672c\u7bc7\u6b63\u6587\u5185\u5bb9\u5427\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u4f60\uff01 element-label\u6807\u7b7e\u91cc\u7684\u6587\u5b57\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f \u60a8\u63d0\u4f9b\u7684\u4ee3\u7801\u4e2d\uff0c\u90e8\u5206\u8868\u5355\u9879\u7684label\u6807\u7b7e\u91cc\u7684\u6587\u5b57\u51fa\u73b0\u5728\u8f93\u5165\u6846\u4e0a\u65b9\u3002\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86el-form\u7ec4\u4ef6\u7684label-width\u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u63a7\u5236label\u6807\u7b7e\u7684\u5bbd\u5ea6\u3002 \u5b98\u7f51\u793a\u4f8b\u4e2d\u7684label\u6807\u7b7e\u5728\u5de6\u8fb9 \u5728element ui\u7684\u5b98\u65b9\u6587\u6863\u4e2d\u5c55\u793a\u7684\u8868\u5355\u9879label\u6807\u7b7e\u90fd\u5728\u8f93\u5165\u6846\u5de6\u8fb9\uff0c\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86\u4ee5\u4e0b\u4ee3\u7801\uff1a &lt;el-form label-position=&#8221;top&#8221;&gt; &#8230; &lt;\/el-form&gt; label-position\u5c5e\u6027\u6307\u5b9alabel\u6807\u7b7e\u7684\u4f4d\u7f6e\uff0c&#8221;top&#8221;\u8868\u793a\u5728\u8f93\u5165\u6846\u4e0a\u65b9\uff0c&#8221;right&#8221;\u8868\u793a\u5728\u8f93\u5165\u6846\u53f3\u8fb9\uff0c\u9ed8\u8ba4\u503c\u4e3a&#8221;left&#8221;\u8868\u793a\u5728\u8f93\u5165\u6846\u5de6\u8fb9\u3002 \u89e3\u51b3\u65b9\u6848\uff1a\u8c03\u6574label-width\u548clabel-position\u5c5e\u6027 \u8981\u5c06label\u6807\u7b7e\u79fb\u52a8\u5230\u8f93\u5165\u6846\u5de6\u8fb9\uff0c\u53ef\u4ee5\u8c03\u6574label-width\u548clabel-position\u5c5e\u6027\uff1a &lt;el-form label-width=&#8221;auto&#8221; label-position=&#8221;left&#8221;&gt; &#8230; &lt;\/el-form&gt; label-width=&#8221;auto&#8221;\u5141\u8bb8label\u6807\u7b7e\u81ea\u52a8\u8c03\u6574\u5bbd\u5ea6\u4ee5\u9002\u5e94\u5176\u5185\u5bb9\u3002 label-position=&#8221;left&#8221;\u5c06label\u6807\u7b7e\u653e\u5728\u8f93\u5165\u6846\u5de6\u8fb9\u3002 \u8c03\u6574\u540e\uff0clabel\u6807\u7b7e\u5c06\u51fa\u73b0\u5728\u8f93\u5165\u6846\u7684\u5de6\u8fb9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a [\u56fe\u7247] \u4eca\u5929\u5173\u4e8e\u300aElement UI \u8868\u5355 label \u6807\u7b7e\u4e3a\u4f55\u51fa\u73b0\u5728\u4e0a\u65b9\uff1f\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u7c73\u4e91\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01 \u6280\u5609z77\u4e3b\u677f\u652f\u6301Win11\u5417 z77\u4e3b\u677f\u662f\u5426\u652f\u6301Win11\u8be6\u7ec6\u4ecb\u7ecd<\/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-53118","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53118","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=53118"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53118\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}