{"id":2743,"date":"2024-11-10T17:23:12","date_gmt":"2024-11-10T09:23:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2743\/"},"modified":"2024-11-10T17:23:12","modified_gmt":"2024-11-10T09:23:12","slug":"ant-design-tooltip-%e4%b8%89%e8%a7%92%e5%9e%8b%e5%b0%8f%e7%ae%ad%e5%a4%b4%e5%8f%98%e6%96%b9%e5%bd%a2%e7%9a%84%e5%8e%9f%e5%9b%a0%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2743\/","title":{"rendered":"Ant Design Tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u65b9\u5f62\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173086884326876.jpg\" class=\"aligncenter\" title=\"Ant Design Tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u65b9\u5f62\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\u63d2\u56fe\" alt=\"Ant Design Tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u65b9\u5f62\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u4e3a\u65b9\u5f62\u7684\u539f\u56e0<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 ant design \u7684 tooltip \u7ec4\u4ef6\u65f6\uff0c\u5f53\u9047\u5230 tooltip \u4e2d\u7684\u4e09\u89d2\u5c0f\u7bad\u5934\u53d8\u4e3a\u65b9\u5f62\u7684\u60c5\u51b5\uff0c\u539f\u56e0\u53ef\u80fd\u662f\u4f60\u4e0d\u5c0f\u5fc3\u914d\u7f6e\u4e86\u4e00\u4e2a 4px \u7684\u503c\u4f5c\u4e3a sizepopuparrow \u5c5e\u6027\uff0c\u5bfc\u81f4\u8ba1\u7b97\u51fa\u9519\u3002<\/p>\n<p>ant design \u6ca1\u6709 8.4 \u7248\u672c\uff0c\u5728 5.8.4 \u7248\u672c\u4e2d\uff0csizepopuparrow \u5c5e\u6027\u5e94\u8be5\u662f\u4e00\u4e2a\u6570\u5b57\u7c7b\u578b\u3002\u5efa\u8bae\u5c06 4px \u6539\u4e3a 4\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>import { Tooltip } from \"antd\";\n\nconst MyComponent = () =&gt; {\n  return (\n    &lt;Tooltip title=\"\u63d0\u793a\u4fe1\u606f\" sizePopupArrow={4}&gt;\n      &lt;div&gt;\u5e26\u6709\u65b9\u5f62\u4e09\u89d2\u661f\u53f7\u7684 Tooltip&lt;\/div&gt;\n    &lt;\/Tooltip&gt;\n  );\n};<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b64\u4fee\u6539\u5c06\u6062\u590d\u5c0f\u7bad\u5934\u4e3a\u4e09\u89d2\u5f62\u5e76\u89e3\u51b3\u60a8\u9047\u5230\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fAnt Design Tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u65b9\u5f62\u7684\u539f\u56e0\u662f\u4ec0\u4e48\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>tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u4e3a\u65b9\u5f62\u7684\u539f\u56e0 \u5728\u4f7f\u7528 ant design \u7684 tooltip \u7ec4\u4ef6\u65f6\uff0c\u5f53\u9047\u5230 tooltip \u4e2d\u7684\u4e09\u89d2\u5c0f\u7bad\u5934\u53d8\u4e3a\u65b9\u5f62\u7684\u60c5\u51b5\uff0c\u539f\u56e0\u53ef\u80fd\u662f\u4f60\u4e0d\u5c0f\u5fc3\u914d\u7f6e\u4e86\u4e00\u4e2a 4px \u7684\u503c\u4f5c\u4e3a sizepopuparrow \u5c5e\u6027\uff0c\u5bfc\u81f4\u8ba1\u7b97\u51fa\u9519\u3002 ant design \u6ca1\u6709 8.4 \u7248\u672c\uff0c\u5728 5.8.4 \u7248\u672c\u4e2d\uff0csizepopuparrow \u5c5e\u6027\u5e94\u8be5\u662f\u4e00\u4e2a\u6570\u5b57\u7c7b\u578b\u3002\u5efa\u8bae\u5c06 4px \u6539\u4e3a 4\uff0c\u5982\u4e0b\u6240\u793a\uff1a import { Tooltip } from &#8220;antd&#8221;; const MyComponent = () =&gt; { return ( &lt;Tooltip title=&#8221;\u63d0\u793a\u4fe1\u606f&#8221; sizePopupArrow={4}&gt; &lt;div&gt;\u5e26\u6709\u65b9\u5f62\u4e09\u89d2\u661f\u53f7\u7684 Tooltip&lt;\/div&gt; &lt;\/Tooltip&gt; ); }; \u767b\u5f55\u540e\u590d\u5236 \u6b64\u4fee\u6539\u5c06\u6062\u590d\u5c0f\u7bad\u5934\u4e3a\u4e09\u89d2\u5f62\u5e76\u89e3\u51b3\u60a8\u9047\u5230\u7684\u95ee\u9898\u3002 \u4ee5\u4e0a\u5c31\u662fAnt Design Tooltip \u4e09\u89d2\u578b\u5c0f\u7bad\u5934\u53d8\u65b9\u5f62\u7684\u539f\u56e0\u662f\u4ec0\u4e48\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2743","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2743","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=2743"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2743\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}