{"id":453,"date":"2025-04-20T15:59:32","date_gmt":"2025-04-20T15:59:32","guid":{"rendered":"https:\/\/shiri.cyou\/?p=453"},"modified":"2025-07-10T08:18:07","modified_gmt":"2025-07-10T08:18:07","slug":"%e7%bb%99primevue%e7%bb%84%e4%bb%b6%e5%ba%93%e6%8f%90%e4%ba%86%e4%b8%aapr","status":"publish","type":"post","link":"https:\/\/shiri.dev\/?p=453","title":{"rendered":"\u7ed9PrimeVue\u7ec4\u4ef6\u5e93\u63d0\u4e86\u4e2aPR"},"content":{"rendered":"<h1>\u80cc\u666f<\/h1>\n<p>\u9879\u76ee\u7528\u7684\u7ec4\u4ef6\u5e93\u662f\u57fa\u4e8e<code>Element Plus<\/code>\u5f00\u53d1\u7684\uff08\u540e\u9762\u7b80\u79f0elm\uff09\uff0c\u4f46\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u53d1\u73b0elm\u7684<code>tooltip<\/code>\u7ec4\u4ef6\u6709\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/03\/image-1743399925560.png\" alt=\"file\" \/><\/p>\n<p>\u8fdb\u4e00\u6b65\u6392\u67e5\uff0c\u53d1\u73b0\u662f<code>Vue-3.3\u7248\u672c<\/code>\u4e0b\uff0c\u5728\u5185\u7f6e\u7684<code>transition<\/code>\u7ec4\u4ef6\u4e2d\u4f7f\u7528<code>v-if<\/code>\u4f1a\u6709\u95ee\u9898<\/p>\n<blockquote>\n<p>\u5b9a\u4f4d\u5230\u8fd9\u4e2a\u56e0\u7d20\uff0c\u662f\u56e0\u4e3a\u5728<code>element-plus<\/code>\u7684<code>playground<\/code>\u4e2d\uff0c\u4f7f\u7528<code>vue<\/code>\u7684<code>3.3.x<\/code>\u7248\u672c\u5b58\u5728\u5185\u5b58\u6cc4\u6f0f\uff0c\u800c<code>3.5.13<\/code>\u7248\u672c\u4e0d\u5b58\u5728<\/p>\n<p>\u5177\u4f53\u6392\u67e5\u8fc7\u7a0b\u5c31\u4e0d\u653e\u4e86\uff0c\u8fd8\u6709\u4e00\u7bc7\u8d85\u957f\u5185\u5b58\u6cc4\u6f0fblog\u6b63\u5728\u586b\u5751\u4e2d<\/p>\n<\/blockquote>\n<p>\u56e0\u65e9\u5c31\u5acc\u5f03elm\u7684<code>tooltip<\/code>\u7ec4\u4ef6\u4f7f\u7528\u65b9\u5f0f\u4e0d\u591f\u4f18\u96c5\uff0c\u9042\u628a\u76ee\u5149\u8f6c\u5411\u53e6\u4e00\u4e2a\u5927\u540d\u9f0e\u9f0e\u7684\u5f00\u6e90Vue3\u7ec4\u4ef6\u5e93\u2014\u2014<code>PrimeVue<\/code>\u3002<\/p>\n<p><code>PrimeVue<\/code>\u4ee5\u6307\u4ee4\u7684\u65b9\u5f0f\u63d0\u4f9b\u4e86<code>tooltip<\/code>\uff0c\u6bd4\u4f7f\u7528\u7ec4\u4ef6\u4f18\u96c5\u5f88\u591a\uff08\u5176\u5b9e\u535a\u4e3b\u5df2\u7ecf\u628aelm\u7684<code>tooltip<\/code>\u4e8c\u6b21\u5c01\u88c5\u4e3a\u6307\u4ee4\u5f62\u5f0f\u4f7f\u7528\u4e86\uff09<\/p>\n<h1>\u6b63\u6587<\/h1>\n<h2>\u95ee\u9898\u5b9a\u4f4d<\/h2>\n<p>\u901a\u8fc7\u5bf9<code>PrimeVue<\/code>\u8fdb\u884c\u4e86\u4e0eelm\u76f8\u540c\u7684\u5185\u5b58\u6cc4\u6f0f\u6d4b\u8bd5\uff08\u53cd\u590d\u89e6\u53d1<code>tooltip<\/code>\u663e\u9690\uff09\uff0c\u53d1\u73b0\u8fd9\u8d27\u7684<code>tooltip<\/code>\u5c45\u7136\u4e5f\u6709\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\uff08\u5982\u4e0b\u56fe\uff09\uff0c\u518d\u6b21\u5370\u8bc1\u4e86\u8349\u53f0\u73ed\u5b50\u7406\u8bba\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745140367098.png\" alt=\"file\" \/><\/p>\n<p>\u4e00\u756a\u6392\u67e5\u540e\uff0c\u6700\u7ec8\u5b9a\u4f4d\u5230\u5bfc\u81f4\u6cc4\u9732\u7684\u4ee3\u7801\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/03\/image-1743400979947.png\" alt=\"file\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u51fa\u53ea\u8981\u4e0d\u89e6\u53d1<code>resize<\/code>\u4e8b\u4ef6\uff0c<code>onWindowResize<\/code>\u65b9\u6cd5\u7684\u95ed\u5305\u4f5c\u7528\u57df\u4e2d\u4f1a\u4e00\u76f4\u6301\u6709\u5bf9<code>el<\/code>\u7684\u5f15\u7528<\/p>\n<p>\u67e5\u4e00\u67e5\u6709\u6ca1\u6709\u76f8\u5173\u7684PR\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745140181950.png\" alt=\"file\" \/><\/p>\n<p>\u53d1\u73b0\u8fd9\u4e2a\u95ee\u9898\u8fd8\u6ca1\u4eba\u89e3\u51b3\uff0c\u76ee\u6d4b\u4fee\u590d\u4e5f\u6bd4\u8f83\u7b80\u5355\uff0c\u6545\u51c6\u5907\u7ed9\u7ec4\u4ef6\u5e93\u63d0\u4e2aPR<\/p>\n<h2>\u68b3\u7406\u903b\u8f91<\/h2>\n<p>\u5148\u6765\u770b\u770b<code>PrimeVue<\/code>\u7684<code>tooltip<\/code>\u90fd\u6709\u5565<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745156770766.png\" alt=\"file\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u91cc\u9762\u6709\u8ddf<code>Vue<\/code>\u6307\u4ee4\u5b9a\u4e49\u5dee\u4e0d\u591a\u7684\u751f\u547d\u5468\u671f\u65b9\u6cd5\u548c\u4e00\u90e8\u5206\u81ea\u5df1\u7684\u5185\u90e8\u65b9\u6cd5<code>methods<\/code>\uff0c\u56fe\u4e2d\u6846\u8d77\u6765\u7684\u90e8\u5206\u5c31\u662f\u4ea7\u751f\u5185\u5b58\u6cc4\u6f0f\u7684\u4e3b\u8981\u4ee3\u7801<\/p>\n<blockquote>\n<p>\u5176\u4e2d\u7684<code>BaseTooltip<\/code>\u662f<code>PrimeVue<\/code>\u5728<code>Vue<\/code>\u7684<code>ObjectDirective<\/code>\u57fa\u7840\u4e0a\u505a\u4e86\u4e8c\u6b21\u5c01\u88c5\u53ca\u81ea\u5df1\u7684\u4e00\u4e9b\u6269\u5c55\u7684\u65b9\u6cd5<\/p>\n<\/blockquote>\n<p>\u987e\u540d\u601d\u4e49\uff0c<code>show<\/code>\u65b9\u6cd5\u7528\u4e8e\u5143\u7d20\u7684\u663e\u793a\uff0c<code>hide<\/code>\u65b9\u6cd5\u7528\u4e8e\u5143\u7d20\u9690\u85cf\uff0c<code>tooltipRemoval<\/code>\u5219\u7528\u4e8e\u79fb\u9664<code>tooltip\u5143\u7d20<\/code>\uff0c\u5c55\u5f00\u770b\u4e00\u4e0b\u5185\u90e8\u4ee3\u7801<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745157201486.png\" alt=\"file\" \/><\/p>\n<p><code>tooltipActions<\/code>\u4ee3\u7801\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745157700642.png\" alt=\"file\" \/><\/p>\n<p>\u5230\u8fd9\u91cc\u6211\u4eec\u53ef\u4ee5\u77e5\u9053\uff1a<\/p>\n<ol>\n<li>\u5728\u89e6\u53d1\u6307\u4ee4\u7ed1\u5b9a\u5143\u7d20\u7684<code>mouseEnter<\/code>\u548c<code>focus<\/code>\u4e8b\u4ef6\u65f6\uff0c\u4f1a\u8c03\u7528<code>show<\/code>\u65b9\u6cd5\u663e\u793a<code>tooltip<\/code><\/li>\n<li><code>show<\/code>\u65b9\u6cd5\u4f1a\u8c03\u7528<code>tooltipActions<\/code>\uff0c\u800c<code>tooltipActions<\/code>\u4e2d\u7684\u4f1a\u521b\u5efa<code>window<\/code>\u4e0a\u7684<code>resize<\/code>\u4e8b\u4ef6\u76d1\u542c\u5668\uff0c\u4e14\u4e0d\u89e6\u53d1\u5c31\u4e0d\u4f1a\u88ab\u91ca\u653e\uff0c\u8fdb\u800c\u5bfc\u81f4<code>el<\/code>\u4e00\u76f4\u88ab\u8be5\u76d1\u542c\u5668\u65b9\u6cd5\u521b\u5efa\u7684<code>\u95ed\u5305\u4f5c\u7528\u57df<\/code>\u5f15\u7528<\/li>\n<\/ol>\n<blockquote>\n<p>\u770b\u7684\u8fc7\u7a0b\u4e2d\u53d1\u73b0\u4e24\u884c\u4e0d\u5bf9\u52b2\u4ee3\u7801\uff0c\u51c6\u5907\u987a\u4fbf\u4e00\u8d77\u6539\u4e86\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745159513758.png\" alt=\"file\" \/><\/p>\n<\/blockquote>\n<h2>\u4fee\u590d\u601d\u8def<\/h2>\n<p>\u9996\u5148,\u6211\u4eec\u9700\u8981\u80fd\u591f<strong>\u4ece\u5916\u9762\u5f15\u7528\u5230\u76d1\u542c\u5668\uff0c\u4ee5\u4fbf\u5728\u5176\u4ed6\u5730\u65b9\u9500\u6bc1<\/strong>\uff0c\u5148\u5c06\u5176\u4ece<code>tooltipActions<\/code>\u91cc\u63d0\u51fa\u6765<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745160952941.png\" alt=\"file\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c<strong>\u9700\u8981\u89e3\u51b3<code>onWindowResize<\/code>\u4e2d<code>el<\/code>\u53c2\u6570\u548c<code>this<\/code>\u6307\u5411\u7684\u95ee\u9898<\/strong>\uff0c\u663e\u7136\u5e94\u8be5\u7528<code>bind<\/code>\u5b8c\u6210\uff08<code>methods<\/code>\u4e2d\u6709<code>bindEvents<\/code>\u65b9\u6cd5\uff09\uff0c\u5728<code>bindEvents<\/code>\u4e2d\u6dfb\u52a0\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745160508420.png\" alt=\"file\" \/><\/p>\n<p>\u518d\u5728<code>tooltipRemoval<\/code>\u548c<code>unbindEvents<\/code>\u91cc\u52a0\u4e0a\u9500\u6bc1\u76d1\u542c\u5668\u7684\u4ee3\u7801<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745160716218.png\" alt=\"file\" \/><\/p>\n<h2>\u6d4b\u8bd5\u6548\u679c<\/h2>\n<p>\u6784\u5efa\u7ec4\u4ef6\u5e93\u5230\u672c\u5730\uff0clink\u5230\u672c\u5730\u9879\u76ee\u6d4b\u8bd5\uff0c\u53cd\u590d\u89e6\u53d1\u663e\u9690\uff0c\u67e5\u770b\u5185\u5b58\u5feb\u7167\u5bf9\u6bd4<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745160229988.png\" alt=\"file\" \/><\/p>\n<p>\u95ee\u9898\u89e3\u51b3\uff0c\u6548\u679c\u7b26\u5408\u9884\u671f<\/p>\n<h2>\u5355\u5143\u6d4b\u8bd5\uff0c\u542f\u52a8\uff01<\/h2>\n<p>\u4ece\u9879\u76ee\u6839\u76ee\u5f55\u7684<code>package.json<\/code>\u4e2d\u53ef\u4ee5\u770b\u5230\u7ec4\u4ef6\u5e93\u662f\u6709\u5355\u5143\u6d4b\u8bd5\u7684<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745156279881.png\" alt=\"file\" \/><\/p>\n<p>\u6267\u884c\u4e00\u4e0b\u5355\u5143\u6d4b\u8bd5\uff0c\u786e\u4fdd\u6ca1\u6709\u4ea7\u751f\u65b0bug\uff08\u5185\u5b58\u6cc4\u6f0f\u7684\u5355\u5143\u6d4b\u8bd5\u8fd8\u6ca1\u7814\u7a76\u600e\u4e48\u5199\uff0c\u4ee5\u540e\u6574\u660e\u767d\u4e86\u518d\u5e2e\u4ed6\u4eec\u8865\u4e0a\uff09<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745155840632.png\" alt=\"file\" \/><\/p>\n<h2>\u63d0\u4ea4PR<\/h2>\n<p>\u63d0\u4ea4\u4ee3\u7801\uff0c\u586b\u5199\u4fe1\u606f\uff0c\u63d0\u4ea4PR\u8868\u5355\u4e00\u6c14\u5475\u6210<\/p>\n<blockquote>\n<p>\u5e76\u6ca1\u6709\uff0c\u597d\u4e45\u4e0d\u7528Github\u63d0\u4ee3\u7801\u53d1\u73b0\u4e0d\u80fd\u7528\u5bc6\u7801\u767b\u5f55\u4e86\uff0c\u53c8\u53bb\u5efa\u4e86\u4e2atoken\u624d\u63d0\u4e0a\u53bb<\/p>\n<\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/shiri.dev\/wp-content\/uploads\/2025\/04\/image-1745164719718.png\" alt=\"file\" \/><\/p>\n<p>\u8d34\u4e2a<a href=\"https:\/\/github.com\/primefaces\/primevue\/pull\/7625\">PR\u94fe\u63a5<\/a>\uff0c\u65b9\u4fbf\u4ee5\u540e\u67e5(xin)\u770b(shang)<\/p>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u7528\u5230<code>window.addEventListener<\/code>\u65b9\u6cd5\u65f6\u9700\u8981\u8c28\u614e\uff0c\u6bd5\u7adf\u50cf<code>PrimeVue<\/code>\u8fd9\u6837\u7684\u77e5\u540d\u5f00\u6e90\u7ec4\u4ef6\u5e93\u4f7f\u7528\u5b83\u65f6\u4e5f\u96be\u514d\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n<p>\u7ed9\u5f00\u6e90\u9879\u76ee\u505a\u4e86\u70b9\u8d21\u732e\uff0c\u81ea\u5df1\u4e5f\u8fdb\u6b65\u4e86\u4e00\u70b9\uff0c\u611f\u89c9\u826f\u597d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u9879\u76ee\u7528\u7684\u7ec4\u4ef6\u5e93\u662f\u57fa\u4e8eElement Plus\u5f00\u53d1\u7684\uff08\u540e\u9762\u7b80\u79f0elm\uff09\uff0c\u4f46\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u53d1\u73b0elm&hellip; <a href=\"https:\/\/shiri.dev\/?p=453\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">\u7ed9PrimeVue\u7ec4\u4ef6\u5e93\u63d0\u4e86\u4e2aPR<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-453","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-uncategorized","7":"h-entry","9":"h-as-article"},"_links":{"self":[{"href":"https:\/\/shiri.dev\/index.php?rest_route=\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shiri.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shiri.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shiri.dev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shiri.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=453"}],"version-history":[{"count":26,"href":"https:\/\/shiri.dev\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":697,"href":"https:\/\/shiri.dev\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions\/697"}],"wp:attachment":[{"href":"https:\/\/shiri.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shiri.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shiri.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}