{"id":25985,"date":"2024-11-24T14:48:48","date_gmt":"2024-11-24T06:48:48","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25985\/"},"modified":"2024-11-24T14:48:48","modified_gmt":"2024-11-24T06:48:48","slug":"element-ui-%e6%8c%89%e9%92%ae%e7%82%b9%e5%87%bb%e5%90%8e%e8%83%8c%e6%99%af%e8%89%b2%e6%ae%8b%e7%95%99%e9%97%ae%e9%a2%98%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25985\/","title":{"rendered":"Element-UI \u6309\u94ae\u70b9\u51fb\u540e\u80cc\u666f\u8272\u6b8b\u7559\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173076984315132.jpg\" class=\"aligncenter\" title=\"Element-UI \u6309\u94ae\u70b9\u51fb\u540e\u80cc\u666f\u8272\u6b8b\u7559\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"Element-UI \u6309\u94ae\u70b9\u51fb\u540e\u80cc\u666f\u8272\u6b8b\u7559\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u907f\u514d\u6309\u94ae\u70b9\u51fb\u540e\u80cc\u666f\u8272\u6b8b\u7559<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 element-ui \u7684\u6309\u94ae\u63a7\u4ef6\u65f6\uff0c\u7ecf\u5e38\u9047\u5230\u70b9\u51fb\u540e\u6309\u94ae\u80cc\u666f\u8272\u4f1a\u7559\u4e0b\uff0c\u53ea\u6709\u70b9\u51fb\u5176\u4ed6\u4f4d\u7f6e\u624d\u80fd\u6d88\u5931\u7684\u95ee\u9898\u3002\u60f3\u8981\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff0c\u53ef\u4ee5\u4ece\u4ee5\u4e0b\u65b9\u9762\u7740\u624b\uff1a<\/p>\n<p><strong>\u4f7f\u7528 javascript \u79fb\u9664\u7126\u70b9<\/strong><\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86 :focus \u4f2a\u7c7b\uff0c\u53ef\u4ee5\u5229\u7528 javascript \u5728\u70b9\u51fb\u6309\u94ae\u4e4b\u5916\u7684\u533a\u57df\u65f6\u79fb\u9664\u8be5\u7126\u70b9\uff1a<\/p>\n<pre>clickhandler(evt) {\n  let target = evt.target;\n  if(target.nodename == \"span\"){\n    target = evt.target.parentnode;\n  }\n  target.blur();\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u4fee\u6539\u6837\u5f0f<\/strong><\/p>\n<p>\u53e6\u4e00\u79cd\u65b9\u5f0f\u662f\u91cd\u65b0\u7f16\u5199\u6837\u5f0f\uff0c\u4f7f\u5f97\u6309\u94ae\u53ea\u6709\u5728\u60ac\u505c\u6216\u70b9\u51fb\u6309\u4e0b\u65f6\u624d\u6709\u80cc\u666f\u8272\uff0c\u800c\u5728\u9f20\u6807\u79fb\u5f00\u540e\u6062\u590d\u539f\u6765\u7684\u6837\u5f0f\uff1a<\/p>\n<pre>\/*\u9f20\u6807\u70b9\u51fb\u540e\u79fb\u5f00\uff0c\u6062\u590d\u672c\u8eab\u6837\u5f0f*\/\n.buttonDiv, .buttonDiv:focus:not(.buttonDiv:hover){ \n  margin-right: 12px;\n  border: 1px solid #2794f8;\n  border-radius: 2px;\n  box-shadow: 0 2px 4px 0 #f4f4f4;\n  color: #2794f8;\n  background: white;\n}\n\/*\u9f20\u6807\u60ac\u6d6e\uff0c\u6ca1\u6709\u6309\u4e0b\uff1b\u9f20\u6807\u6309\u4e0b\u540e\u62ac\u8d77\uff0c\u6ca1\u6709\u79fb\u5f00*\/\n.buttonDiv:focus, .buttonDiv:hover{\n  background: #eaf5ff;\n  border: 1px solid #2794f8 !important;\n  color: #2794f8;\n}\n\/*\u9f20\u6807\u6309\u4e0b\uff0c\u6ca1\u6709\u62ac\u8d77*\/\n.buttonDiv:active {\n  background: #2794f8;\n  color: white;\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fElement-UI \u6309\u94ae\u70b9\u51fb\u540e\u80cc\u666f\u8272\u6b8b\u7559\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u907f\u514d\u6309\u94ae\u70b9\u51fb\u540e\u80cc\u666f\u8272\u6b8b\u7559 \u5728\u4f7f\u7528 element-ui \u7684\u6309\u94ae\u63a7\u4ef6\u65f6\uff0c\u7ecf\u5e38\u9047\u5230\u70b9\u51fb\u540e\u6309\u94ae\u80cc\u666f\u8272\u4f1a\u7559\u4e0b\uff0c\u53ea\u6709\u70b9\u51fb\u5176\u4ed6\u4f4d\u7f6e\u624d\u80fd\u6d88\u5931\u7684\u95ee\u9898\u3002\u60f3\u8981\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff0c\u53ef\u4ee5\u4ece\u4ee5\u4e0b\u65b9\u9762\u7740\u624b\uff1a \u4f7f\u7528 javascript \u79fb\u9664\u7126\u70b9 \u8fd9\u662f\u56e0\u4e3a\u4f7f\u7528\u4e86 :focus \u4f2a\u7c7b\uff0c\u53ef\u4ee5\u5229\u7528 javascript \u5728\u70b9\u51fb\u6309\u94ae\u4e4b\u5916\u7684\u533a\u57df\u65f6\u79fb\u9664\u8be5\u7126\u70b9\uff1a clickhandler(evt) { let target = evt.target; if(target.nodename == &#8220;span&#8221;){ target = evt.target.parentnode; } target.blur(); } \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u6837\u5f0f \u53e6\u4e00\u79cd\u65b9\u5f0f\u662f\u91cd\u65b0\u7f16\u5199\u6837\u5f0f\uff0c\u4f7f\u5f97\u6309\u94ae\u53ea\u6709\u5728\u60ac\u505c\u6216\u70b9\u51fb\u6309\u4e0b\u65f6\u624d\u6709\u80cc\u666f\u8272\uff0c\u800c\u5728\u9f20\u6807\u79fb\u5f00\u540e\u6062\u590d\u539f\u6765\u7684\u6837\u5f0f\uff1a \/*\u9f20\u6807\u70b9\u51fb\u540e\u79fb\u5f00\uff0c\u6062\u590d\u672c\u8eab\u6837\u5f0f*\/ .buttonDiv, .buttonDiv:focus:not(.buttonDiv:hover){ margin-right: 12px; border: 1px solid #2794f8; border-radius: 2px; box-shadow: 0 2px 4px 0 #f4f4f4; color: #2794f8; background: white; } \/*\u9f20\u6807\u60ac\u6d6e\uff0c\u6ca1\u6709\u6309\u4e0b\uff1b\u9f20\u6807\u6309\u4e0b\u540e\u62ac\u8d77\uff0c\u6ca1\u6709\u79fb\u5f00*\/ .buttonDiv:focus, .buttonDiv:hover{ [&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-25985","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25985","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=25985"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25985\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}