{"id":2814,"date":"2024-11-10T08:47:18","date_gmt":"2024-11-10T00:47:18","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2814\/"},"modified":"2024-11-10T08:47:18","modified_gmt":"2024-11-10T00:47:18","slug":"%e5%89%8d%e7%ab%af%e5%bc%80%e5%8f%91%e4%b8%ad%ef%bc%8c%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e5%8f%82%e6%95%b0%e4%bc%a0%e9%80%92%e7%bb%99%e5%8f%a6%e4%b8%80%e4%b8%aa%e4%ba%8b%e4%bb%b6%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2814\/","title":{"rendered":"\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173088586749240.jpg\" class=\"aligncenter\" title=\"\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff1f\u63d2\u56fe\" alt=\"\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u53c2\u6570\u4f20\u9012\u95ee\u9898<\/strong><\/p>\n<p>\u5728\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u6709\u65f6\u9700\u8981\u5c06\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u7684\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c\u5728\u4e00\u4e2a\u5e26\u6709\u7ec4\u5408\u6811\uff08combotree\uff09\u7ec4\u4ef6\u7684\u7528\u6237\u754c\u9762\u4e2d\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4ece\u7ec4\u5408\u6811\u4e2d\u83b7\u53d6\u4e00\u4e2a id\uff0c\u7136\u540e\u4f7f\u7528\u8be5 id \u67e5\u627e\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55\u3002\u4e4b\u540e\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u8be5\u8bb0\u5f55\u7684\u6570\u636e\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u5904\u7406\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u5462\uff1f<\/p>\n<p><strong>\u76f4\u63a5\u4f20\u9012\u53c2\u6570<\/strong><\/p>\n<p>\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u51fd\u6570\u53c2\u6570\u6765\u4f20\u9012\u53c2\u6570\u3002\u5177\u4f53\u800c\u8a00\uff0c\u60a8\u53ef\u4ee5\u5c06\u4ece\u7b2c\u4e00\u4e2a\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u7684\u53c2\u6570\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u4e8b\u4ef6\u7684\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u3002\u4f8b\u5982\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>const firstEvent = () =&gt; {\n  const id = getCombotreeId();\n  secondEvent(id);\n};\n\nconst secondEvent = (id) =&gt; {\n  \/\/ \u4f7f\u7528 id \u67e5\u8be2\u6570\u636e\u5e93\n  const record = findRecordById(id);\n  \/\/ \u5bf9 record \u6570\u636e\u8fdb\u884c\u8fdb\u4e00\u6b65\u5904\u7406\n};<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u5c06\u4ece\u7b2c\u4e00\u4e2a\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u7684\u53c2\u6570\u76f4\u63a5\u4f20\u9012\u7ed9\u7b2c\u4e8c\u4e2a\u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u5728\u7b2c\u4e8c\u4e2a\u4e8b\u4ef6\u4e2d\u4f7f\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\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>\u53c2\u6570\u4f20\u9012\u95ee\u9898 \u5728\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u6709\u65f6\u9700\u8981\u5c06\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u7684\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c\u5728\u4e00\u4e2a\u5e26\u6709\u7ec4\u5408\u6811\uff08combotree\uff09\u7ec4\u4ef6\u7684\u7528\u6237\u754c\u9762\u4e2d\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4ece\u7ec4\u5408\u6811\u4e2d\u83b7\u53d6\u4e00\u4e2a id\uff0c\u7136\u540e\u4f7f\u7528\u8be5 id \u67e5\u627e\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55\u3002\u4e4b\u540e\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06\u8be5\u8bb0\u5f55\u7684\u6570\u636e\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u5904\u7406\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u5462\uff1f \u76f4\u63a5\u4f20\u9012\u53c2\u6570 \u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u51fd\u6570\u53c2\u6570\u6765\u4f20\u9012\u53c2\u6570\u3002\u5177\u4f53\u800c\u8a00\uff0c\u60a8\u53ef\u4ee5\u5c06\u4ece\u7b2c\u4e00\u4e2a\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u7684\u53c2\u6570\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u4e8b\u4ef6\u7684\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u3002\u4f8b\u5982\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b const firstEvent = () =&gt; { const id = getCombotreeId(); secondEvent(id); }; const secondEvent = (id) =&gt; { \/\/ \u4f7f\u7528 id \u67e5\u8be2\u6570\u636e\u5e93 const record = findRecordById(id); \/\/ \u5bf9 record \u6570\u636e\u8fdb\u884c\u8fdb\u4e00\u6b65\u5904\u7406 }; \u767b\u5f55\u540e\u590d\u5236 \u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u5c06\u4ece\u7b2c\u4e00\u4e2a\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u7684\u53c2\u6570\u76f4\u63a5\u4f20\u9012\u7ed9\u7b2c\u4e8c\u4e2a\u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u5728\u7b2c\u4e8c\u4e2a\u4e8b\u4ef6\u4e2d\u4f7f\u7528\u3002 \u4ee5\u4e0a\u5c31\u662f\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\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-2814","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2814","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=2814"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2814\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}