{"id":2853,"date":"2024-11-10T09:27:40","date_gmt":"2024-11-10T01:27:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2853\/"},"modified":"2024-11-10T09:27:40","modified_gmt":"2024-11-10T01:27:40","slug":"%e5%a6%82%e4%bd%95%e5%b0%86%e6%95%b0%e6%8d%ae%e4%bb%8e%e4%b8%80%e4%b8%aa%e4%ba%8b%e4%bb%b6%e4%bc%a0%e9%80%92%e5%88%b0%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\/2853\/","title":{"rendered":"\u5982\u4f55\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173089452667097.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528\u53c2\u6570\u4f20\u9012\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u6570\u636e\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6<\/strong><\/p>\n<p>\u5728\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u9700\u8981\u5728\u4e0d\u540c\u4e8b\u4ef6\u4e4b\u95f4\u4f20\u9012\u6570\u636e\u4ee5\u8fdb\u884c\u5904\u7406\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u53c2\u6570\u4f20\u9012\u4ece\u4e00\u4e2a\u83b7\u53d6\u5230\u7684\u53c2\u6570\u67e5\u8be2\u7ed3\u679c\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\u3002<\/p>\n<p>\u5728\u4f60\u7684\u60c5\u51b5\u4e0b\uff0c\u4f60\u5df2\u7ecf\u4ece\u4e00\u4e2a combotree \u70b9\u51fb\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u4e86\u4e00\u4e2a id\uff0c\u5e76\u4f7f\u7528\u8be5 id \u67e5\u8be2\u51fa\u4e00\u6761\u6570\u636e\u3002\u8981\u5c06\u6b64\u6570\u636e\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u51fd\u6570\u4f5c\u4e3a\u5224\u65ad\u4f9d\u636e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u53c2\u6570\u4f20\u9012\u3002<\/p>\n<p>\u4fee\u6539\u4f60\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>function onClickCombotree(id) {\n  \/\/ \u67e5\u8be2\u6570\u636e\n  const data = queryData(id);\n\n  \/\/ \u8c03\u7528\u53e6\u4e00\u4e2a\u51fd\u6570\uff0c\u5e76\u4f20\u9012\u6570\u636e\u4f5c\u4e3a\u53c2\u6570\n  onAnotherFunction(data);\n}\n\nfunction onAnotherFunction(data) {\n  \/\/ \u6839\u636e data \u8fdb\u884c\u5224\u65ad\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u4f20\u9012\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u5904\u7406\u548c\u5224\u65ad\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\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>\u5982\u4f55\u4f7f\u7528\u53c2\u6570\u4f20\u9012\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u6570\u636e\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6 \u5728\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u9700\u8981\u5728\u4e0d\u540c\u4e8b\u4ef6\u4e4b\u95f4\u4f20\u9012\u6570\u636e\u4ee5\u8fdb\u884c\u5904\u7406\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u53c2\u6570\u4f20\u9012\u4ece\u4e00\u4e2a\u83b7\u53d6\u5230\u7684\u53c2\u6570\u67e5\u8be2\u7ed3\u679c\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u4e8b\u4ef6\u3002 \u5728\u4f60\u7684\u60c5\u51b5\u4e0b\uff0c\u4f60\u5df2\u7ecf\u4ece\u4e00\u4e2a combotree \u70b9\u51fb\u4e8b\u4ef6\u4e2d\u83b7\u53d6\u4e86\u4e00\u4e2a id\uff0c\u5e76\u4f7f\u7528\u8be5 id \u67e5\u8be2\u51fa\u4e00\u6761\u6570\u636e\u3002\u8981\u5c06\u6b64\u6570\u636e\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u51fd\u6570\u4f5c\u4e3a\u5224\u65ad\u4f9d\u636e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u53c2\u6570\u4f20\u9012\u3002 \u4fee\u6539\u4f60\u7684\u4ee3\u7801\u5982\u4e0b\uff1a function onClickCombotree(id) { \/\/ \u67e5\u8be2\u6570\u636e const data = queryData(id); \/\/ \u8c03\u7528\u53e6\u4e00\u4e2a\u51fd\u6570\uff0c\u5e76\u4f20\u9012\u6570\u636e\u4f5c\u4e3a\u53c2\u6570 onAnotherFunction(data); } function onAnotherFunction(data) { \/\/ \u6839\u636e data \u8fdb\u884c\u5224\u65ad } \u767b\u5f55\u540e\u590d\u5236 \u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u4f20\u9012\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\u53e6\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u5904\u7406\u548c\u5224\u65ad\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5c06\u6570\u636e\u4ece\u4e00\u4e2a\u4e8b\u4ef6\u4f20\u9012\u5230\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-2853","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2853","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=2853"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2853\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}