{"id":34207,"date":"2024-11-25T13:58:16","date_gmt":"2024-11-25T05:58:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/34207\/"},"modified":"2024-11-25T13:58:16","modified_gmt":"2024-11-25T05:58:16","slug":"%e6%b7%b1%e5%85%a5%e8%a7%a3%e6%9e%90%e5%b0%8f%e7%a8%8b%e5%ba%8f%e4%b8%ad%e7%9a%84%e7%9a%84%e5%8f%8c%e7%ba%bf%e7%a8%8b%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/34207\/","title":{"rendered":"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b"},"content":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u5e26\u5927\u5bb6\u7406\u89e3\u4e00\u4e0b\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\uff0c\u804a\u804a\u4ec0\u4e48\u662f\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\uff1f\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e0d\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\uff0c\u800c\u4f7f\u7528\u53cc\u7ebf\u7a0b\u6a21\u578b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/024\/61ebbaf7983c0817.jpg\" class=\"aligncenter\" title=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe\" alt=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe\" \/><\/p>\n<p>\u6709\u8fc7\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7ecf\u9a8c\u7684\u670b\u53cb\u5e94\u8be5\u90fd\u77e5\u9053\u201c\u53cc\u7ebf\u7a0b\u6a21\u578b\u201d\u8fd9\u4e2a\u6982\u5ff5\uff0c\u672c\u6587\u7b80\u5355\u68b3\u7406\u4e00\u4e0b\u53cc\u7ebf\u7a0b\u6a21\u578b\u7684\u4e00\u4e9b\u79d1\u666e\u77e5\u8bc6\uff0c\u5b66\u8bc6\u6d45\u8584\uff0c\u82e5\u6709\u9519\u8bef\u6b22\u8fce\u6307\u6b63\u3002<\/p>\n<p>\u6211\u4ee5\u524d\u5c31\u804c\u4e8e\u300c\u5c0f\u7a0b\u5e8f\u00b7\u4e91\u5f00\u53d1\u300d\u56e2\u961f\uff0c\u5728\u5bf9\u5916\u7684\u4e00\u4e9b\u57f9\u8bad\u548c\u6280\u672f\u5206\u4eab\u91cc\u7ecf\u5e38\u88ab\u4eba\u95ee\u5230\u8fd9\u6837\u4e00\u4e2a\u95ee\u9898\uff1a\u201c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e0e Web \u7f51\u7ad9\u5728\u6280\u672f\u5c42\u9762\u7684\u4e3b\u8981\u533a\u522b\u662f\u4ec0\u4e48\uff1f\u201d\uff0c\u5728\u7f16\u7a0b\u8bed\u8a00\u548c\u8303\u5f0f\u4e0a\uff0c\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e0e Web \u524d\u7aef\u5f00\u53d1\u975e\u5e38\u76f8\u4f3c\uff08\u6bd4\u5982\u90fd\u7528 JavaScript \u8bed\u8a00\u3001\u4e0e HTML\/CSS \u975e\u5e38\u76f8\u4f3c\u7684 WXML\/WXSS \u7b49\uff09\uff0c\u53ef\u5b83\u5374\u6ca1\u6709\u76f4\u63a5\u7528\u539f\u751f\u7684\u524d\u7aef\u6280\u672f\u3002\u3010\u76f8\u5173\u5b66\u4e60\u63a8\u8350\uff1a\u3011<\/p>\n<p>\u4e0e Web \u7f51\u7ad9\u76f8\u6bd4\uff0c\u4ee5\u5fae\u4fe1\u4e3a\u5bbf\u4e3b\u7684\u5c0f\u7a0b\u5e8f\u66f4\u9700\u8981\u8003\u8651<strong>\u5b89\u5168\u3001\u6027\u80fd<\/strong>\u7b49\u56e0\u7d20\uff0c\u4fdd\u969c\u5c0f\u7a0b\u5e8f\u4e0d\u4f1a\u5bf9\u5fae\u4fe1App\u672c\u8eab\u4ea7\u751f\u5b89\u5168\u9690\u60a3\uff0c\u540c\u65f6\u8981\u5c3d\u91cf\u8fbe\u5230\u63a5\u8fd1\u539f\u751f\u5e94\u7528\u7684\u6027\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u3002\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e0d\u76f4\u63a5\u7528\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\uff0c\u975e\u8981\u81ea\u5df1\u5f04\u4e00\u5957\u53cc\u7ebf\u7a0b\u6a21\u578b\u6700\u4e3b\u8981\u7684\u4e24\u4e2a\u539f\u56e0\u3002<\/p>\n<p><strong>\u90a3\u4ec0\u4e48\u662f\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u5462\uff1f<\/strong><\/p>\n<p>\u7406\u89e3\u4e00\u4e2a\u65b0\u6982\u5ff5\u6216\u6280\u672f\u7684\u6700\u597d\u7684\u65b9\u6cd5\u5c31\u662f\u7ed9\u5b83\u4e00\u4e2a\u53c2\u7167\u7269\uff0c\u6240\u4ee5\u8981\u641e\u6e05\u695a\u5c0f\u7a0b\u5e8f\u7684\u7ebf\u7a0b\u6a21\u578b\uff0c\u9996\u5148\u8981\u5bf9\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\u6709\u4e00\u5b9a\u7684\u4e86\u89e3\u3002<\/p>\n<h2>\u6d4f\u89c8\u5668\u662f\u591a\u8fdb\u7a0b\u7684<\/h2>\n<p>\u53ef\u80fd\u6bcf\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08\u5728\u521a\u5165\u884c\u7684\u65f6\u5019\u90fd\u4e0d\u6b62\u4e00\u6b21\u5730\u88ab\u9762\u8bd5\u5b98\u95ee\u5230\u201c\u600e\u4e48\u7406\u89e3\u524d\u7aef\u7684\u5355\u7ebf\u7a0b\uff1f\u201d\uff0c\u56e0\u4e3a\u524d\u7aef\u6838\u5fc3\u6280\u80fd\u4e4b\u4e00\u7684 JavaScript \u8bed\u8a00\u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u5145\u5206\u7406\u89e3\u5e76\u638c\u63e1JS\u5355\u7ebf\u7a0b\u7684\u8fd0\u4f5c\u65b9\u5f0f\u5bf9\u4e00\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08\u6765\u8bf4\u662f\u6700\u57fa\u672c\u7684\u8981\u6c42\u3002\u4f46\u662f\u5f88\u591a\u521d\u5b66\u8005\u5bb9\u6613\u8d70\u5165\u7684\u4e00\u4e2a\u8bef\u533a\uff1a\u9519\u8bef\u5730\u628a \u201cJavaScript \u5355\u7ebf\u7a0b\u201d\u7406\u89e3\u4e3a\u201c\u6d4f\u89c8\u5668\u5355\u7ebf\u7a0b\u201d\u3002<\/p>\n<p>\u4e8b\u5b9e\u4e0a\uff0c\u6d4f\u89c8\u5668\u5185\u90e8\u67b6\u6784\u5f88\u590d\u6742\uff0c\u53ea\u4e0d\u8fc7\u5728\u5904\u7406 GUI \u6e32\u67d3\u7ebf\u7a0b\u548c JavaScript \u903b\u8f91\u811a\u672c\u7ebf\u7a0b\u4e0a\u7528\u4e86<strong>\u4e92\u65a5\u3001\u963b\u585e<\/strong>\u7684\u7ba1\u7406\u6a21\u5f0f\uff0c\u8ba9\u4e00\u4e9b\u5f00\u53d1\u8005\u4ea7\u751f\u4e86\u8bef\u89e3\u3002<\/p>\n<p>\u4ee5 Chrome \u6d4f\u89c8\u5668\u4e3a\u4f8b\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u8bbe\u7f6e\u6309\u94ae\u7136\u540e\u8fdb\u5165\u201c\u66f4\u591a\u5de5\u5177\u201d-&gt;\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d\u4f1a\u770b\u5230\u8fd9\u6837\u7684\u5f39\u7a97\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/024\/656ed7248ed6a197973ba68b1ac6f246-0.png\" class=\"aligncenter\" title=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe1\" alt=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe1\" \/><\/p>\n<p>\u80fd\u770b\u5230Chrome \u5f00\u542f\u4e86\u591a\u4e2a\u8fdb\u7a0b\uff0c\u5305\u62ec\u6d4f\u89c8\u5668\u8fdb\u7a0b\u3001\u7f51\u7edc\u8fdb\u7a0b\u3001GPU \u8fdb\u7a0b\u7b49\uff0c\u8fd9\u4e9b\u90fd\u662f\u901a\u7528\u7684\u8fdb\u7a0b\u3002<strong>\u8bf7\u6ce8\u610f<\/strong>\uff0c\u4e0a\u56fe\u91cc\u6709\u4e24\u4e2a\u6807\u7b7e\u9875\u8fdb\u7a0b\uff0cChrome \u4e3a\u6bcf\u4e2a\u6807\u7b7e\u9875\u5f00\u542f\u4e86\u4e00\u4e2a\u72ec\u7acb\u7684\u6e32\u67d3\u8fdb\u7a0b\uff08 Renderer Process \uff09\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u8d44\u6e90\uff08 CPU\u3001\u5185\u5b58\u7b49\uff09\u548c\u884c\u4e3a\uff08 UI\u3001\u903b\u8f91\u7b49\uff09\u4e92\u4e0d\u5171\u4eab\uff0c\u6240\u4ee5\u5373\u4fbf\u67d0\u4e2a\u6807\u7b7e\u9875\u5d29\u6e83\u4e86\u4e5f\u4e0d\u4f1a\u5f71\u54cd\u5176\u4ed6\u6807\u7b7e\u9875\u3002<\/p>\n<p>\u800c\u5728\u6bcf\u4e2a\u6807\u7b7e\u9875\u8fdb\u7a0b\u4e2d\uff0c\u6d4f\u89c8\u5668\u4f1a\u628a\u4e0d\u540c\u7684\u5de5\u4f5c\u4ea4\u7ed9\u5bf9\u5e94\u7684\u7ebf\u7a0b\uff0c\u6bd4\u5982 GUI \u6e32\u67d3\u7ebf\u7a0b\u8d1f\u8d23\u628a HTML \u6e32\u67d3\u6210\u53ef\u89c6\u5316\u7684 UI\uff1bJavaScript \u5f15\u64ce\u7ebf\u7a0b\u8d1f\u8d23\u89e3\u6790\u548c\u8fd0\u884c JavaScript \u4ee3\u7801\u903b\u8f91\uff1b\u5b9a\u65f6\u89e6\u53d1\u5668\u7ebf\u7a0b\u8d1f\u8d23\u5904\u7406 setTimeout\/setInterval \u5b9a\u65f6\u5668\u7b49\u3002<\/p>\n<blockquote><p>\n  \u591a\u8bf4\u4e00\u53e5\uff0c\u8fd9\u91cc\u6709\u4e00\u4e2a\u5f88\u5bb9\u6613\u641e\u6df7\u7684\u5730\u65b9\uff0c\u5176\u5b9esetTimeout\/setInterval \u5e76\u4e0d\u662f JavaScript \u8bed\u8a00\u7684\u4e00\u90e8\u5206\uff0c\u800c\u662f\u8fd0\u884c\u65f6\uff08\u6700\u521d\u662f\u6d4f\u89c8\u5668\uff0c\u540e\u6765 Node.js \u4e5f\u652f\u6301\uff09\u63d0\u4f9b\u7684\u80fd\u529b\u3002\n<\/p><\/blockquote>\n<p>GUI \u6e32\u67d3\u7ebf\u7a0b\u548c JavaScript \u5f15\u64ce\u7ebf\u7a0b\u662f\u4e92\u65a5\u7684\uff0cJavaScript \u5728\u6267\u884c\u671f\u95f4\u4f1a\u963b\u585e UI \u7684\u6e32\u67d3\uff0c\u751a\u81f3\u5982\u679c\u811a\u672c\u6267\u884c\u65f6\u95f4\u592a\u957f\u4f1a\u7531\u4e8e\u9875\u9762\u957f\u65f6\u95f4\u65e0\u54cd\u5e94\u7136\u540e\u5d29\u6e83\uff0c\u6b63\u662f GUI \u6e32\u67d3\u7ebf\u7a0b\u548c JavaScript \u5f15\u64ce\u7ebf\u7a0b\u4e4b\u95f4\u7684\u8fd9\u79cd\u4e92\u65a5\u3001\u963b\u585e\u7684\u7ebf\u7a0b\u7ba1\u7406\u65b9\u5f0f\uff0c\u8ba9\u4e00\u90e8\u5206\u524d\u7aef\u5f00\u53d1\u8005\u4ee5\u4e3a\u6d4f\u89c8\u5668\u662f\u5355\u7ebf\u7a0b\u7684\u3002<\/p>\n<p><strong>\u90a3\u4e3a\u4ec0\u4e48 JavaScript \u88ab\u8bbe\u8ba1\u6210\u5355\u7ebf\u7a0b\u7684\u5462\uff1f<\/strong><\/p>\n<p>JavaScript \u7956\u5e08\u7237\u53ea\u7528\u4e86 10 \u5929\u5c31\u521b\u9020\u4e86\u8fd9\u95e8\u8bed\u8a00\uff0c\u6700\u521d\u4ed6\u7684\u60f3\u6cd5\u53ea\u662f\u5728\u6d4f\u89c8\u5668\u4e2d\u63d0\u4f9b\u4e00\u4e9b\u7b80\u5355\u7684\u811a\u672c\u903b\u8f91\u7528\u6765\u5904\u7406\u7528\u6237\u4ea4\u4e92\u3001DOM \u64cd\u4f5c\u7b49\uff0c\u6240\u4ee5\u4ece\u8bbe\u8ba1\u4e0a\u5fc5\u987b\u9075\u5faa\u4e24\u70b9\uff1a<\/p>\n<ul>\n<li>\n<p>\u8bed\u6cd5\u7b80\u5355\uff1b<\/p>\n<\/li>\n<li>\n<p>\u8fd0\u884c\u673a\u5236\u7b80\u5355\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5728\u8bed\u6cd5\u4e0a\uff0cJavaScript \u501f\u9274\u4e86 Java\uff0c\u4f46\u662f\u53bb\u9664\u4e86\u5f88\u591a\u590d\u6742\u7684\u8bbe\u5b9a\uff0c\u6bd4\u5982\u7c7b\u578b\u58f0\u660e\u3001\u6a21\u5757\u4f53\u7cfb\uff08\u540e\u6765\u52a0\u5165\uff09\u7b49\u3002<\/p>\n<p>\u5728\u8fd0\u884c\u673a\u5236\u4e0a\uff0cJavaScript \u5e76\u6ca1\u6709\u50cf Java \u90a3\u6837\u63d0\u4f9b\u591a\u7ebf\u7a0b\u80fd\u529b\uff0c\u6700\u4e3b\u8981\u5c31\u662f\u4e3a\u4e86\u907f\u514d\u591a\u7ebf\u7a0b\u64cd\u4f5c DOM \u9020\u6210 UI \u51b2\u7a81\u3002\u6bd4\u5982\u5b58\u5728\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u64cd\u4f5c\u540c\u4e00\u4e2a DOM\uff0c\u6d4f\u89c8\u5668\u8be5\u5982\u4f55\u5224\u65ad\u6700\u7ec8\u7684 UI \u6548\u679c\u662f\u91c7\u7528\u54ea\u4e2a\u7ebf\u7a0b\u7684\u7ed3\u679c\uff1f\u8fd9\u662f\u7ecf\u5178\u7684\u7ebf\u7a0b\u5b89\u5168\uff08\u4e5f\u79f0\u4e3a\u7ebf\u7a0b\u540c\u6b65\uff09\u95ee\u9898\uff0c\u5728\u591a\u7ebf\u7a0b\u7f16\u7a0b\u9886\u57df\u6709\u5f88\u591a\u89e3\u51b3\u65b9\u6848\uff0c\u6bd4\u5982\u52a0\u5165\u9501\u673a\u5236\uff0c\u4f46\u8fd9\u6837\u5374\u53c8\u5e26\u6765\u4e86\u66f4\u591a\u7684\u590d\u6742\u6027\uff0c\u4e0e JavaScript \u7b80\u5355\u6613\u7528\u7684\u8bbe\u8ba1\u521d\u8877\u76f8\u8fdd\u80cc\u3002<\/p>\n<p>\u8fd9\u540c\u65f6\u4e5f\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48 GUI \u6e32\u67d3\u7ebf\u7a0b\u4e0e JavaScript \u5f15\u64ce\u7ebf\u7a0b\u662f\u4e92\u65a5\u7684\uff1aJavaScript \u4ee3\u7801\u6709\u4fee\u6539DOM \u7684\u6743\u9650\u3002<\/p>\n<p>\u5f53 JavaScript \u4ee3\u7801\u88ab\u6267\u884c\u65f6\uff0cGUI \u6e32\u67d3\u7ebf\u7a0b\u4f1a\u88ab\u6302\u8d77\uff0c\u7b49\u5f85 JavaScript \u5f15\u64ce\u7ebf\u7a0b\u7a7a\u95f2\u65f6\u518d\u88ab\u6267\u884c\uff0c\u4ee5\u514d\u5728\u6e32\u67d3\u671f\u95f4\u88ab JavaScript \u91cd\u590d\u5730\u4fee\u6539 DOM \u9020\u6210\u4e0d\u5fc5\u8981\u7684\u6e32\u67d3\u538b\u529b\u3002\u91c7\u7528\u4e92\u65a5\u7684\u6a21\u5f0f\u7b49\u5f85 JavaScript \u4ee3\u7801\u6267\u884c\u5b8c\u6bd5\u540e\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u6e32\u67d3\u662f\u6700\u7ec8\u7684\u6267\u884c\u7ed3\u679c\u3002\u6240\u4ee5\u6d4f\u89c8\u5668\u7684\u7a7a\u95f2\uff08Idle\uff09\u65f6\u957f\u4e5f\u6210\u4e86\u8861\u91cf\u7f51\u7ad9\u6027\u80fd\u7684\u91cd\u8981\u6307\u6807\u4e4b\u4e00\uff0c\u7a7a\u95f2\u65f6\u957f\u591a\u4ee3\u8868 JavaScript \u903b\u8f91\u4e0d\u5bc6\u96c6\u4ee5\u53ca DOM\u6539\u52a8\u9891\u7387\u4f4e\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u6d4f\u89c8\u5668\u53ef\u4ee5\u66f4\u5feb\u901f\u987a\u7545\u5730\u54cd\u5e94\u7528\u6237\u7684\u4ea4\u4e92\u884c\u4e3a\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/024\/5e3d9b1ba152584629d46ceb941a80cf-1.png\" class=\"aligncenter\" title=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe2\" alt=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe2\" \/><\/p>\n<blockquote>\n<p>React Fiber\u5c31\u662f\u5229\u7528idle\u65f6\u95f4\u8fdb\u884c\u5206\u7247\u4efb\u52a1\u5904\u7406\u3002<\/p>\n<\/blockquote>\n<p>\u540e\u6765\uff0cHTML5 \u5f15\u5165\u4e86 Web Worker\uff0c\u63d0\u4f9b\u591a\u7ebf\u7a0b\u6267\u884c JavaScript \u4ee3\u7801\u7684\u80fd\u529b\uff0c\u4f46\u662f\u4e0e\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u4e0d\u540c\u7684\u662f\uff0cWorker \u7ebf\u7a0b\u4e0e\u4e3b\u7ebf\u7a0b\u5e76\u4e0d\u662f\u5e73\u884c\u7684\uff0c\u800c\u662f\u4e00\u79cd\u4e3b\u4ece\uff08 Master-Slave\uff09\u591a\u7ebf\u7a0b\u6a21\u578b\u3002<\/p>\n<p>Worker \u5185\u7684 JavaScript \u4ee3\u7801\u4e0d\u80fd\u64cd\u4f5c DOM\uff0c\u53ef\u4ee5\u5c06\u5176\u7406\u89e3\u4e3a<strong>\u7ebf\u7a0b\u5b89\u5168<\/strong>\u7684\u3002<strong>\u8981\u8bb0\u4f4f\u8fd9\u4e00\u70b9\uff0c\u8fd9\u662f\u540e\u9762\u8bb2\u5c0f\u7a0b\u5e8f\u53cc\u7ebf\u7a0b\u6a21\u578b\u4e00\u4e2a\u91cd\u8981\u7684\u57fa\u7840\u3002<\/strong><\/p>\n<p>\u90a3\u4e48\u4e3a\u4ec0\u4e48\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e0d\u76f4\u63a5\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\u5462\uff1f\u8fd9\u9700\u8981\u4ece\u4ea7\u54c1\u548c\u6280\u672f\u4e24\u4e2a\u89d2\u5ea6\u5bf9\u6bd4\u5c0f\u7a0b\u5e8f\u4e0e Web \u7f51\u7ad9\u7684\u5dee\u5f02\u3002<\/p>\n<h2>\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e0d\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b<\/h2>\n<p>\u6211\u521a\u63a5\u89e6\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u65f6\uff0c\u7ecf\u5e38\u201c\u5acc\u5f03\u201d\u5b83\u8ddf Web \u76f8\u6bd4\u9609\u5272\u5f31\u5316\u7684\u80fd\u529b\u3001\u8ddf Vue \u76f8\u6bd4\u7b80\u5355\u5230\u8fc7\u5206\u7684\u8bed\u6cd5\u7b49\u3002\u5f53\u65f6\uff0c\u6211\u51e0\u4e4e\u89c9\u5f97\u5c0f\u7a0b\u5e8f\u5c31\u662f\u5fae\u4fe1\u4ed7\u7740\u81ea\u5df1\u5e9e\u5927\u7684\u7528\u6237\u91cf\u641e\u6280\u672f\u5784\u65ad\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u968f\u7740\u5bf9\u6280\u672f\u548c\u4ea7\u54c1\u7684\u4e0d\u65ad\u6df1\u5165\u7406\u89e3\uff0c\u6211\u5bf9\u5c0f\u7a0b\u5e8f\u7684\u6001\u5ea6\u4e5f\u6709\u4e86\u8f6c\u53d8\uff0c\u7531\u201c\u5acc\u5f03\u201d\u53d8\u6210\u4e86\u656c\u4f69\uff0c\u56e0\u4e3a\u5728\u5145\u5206\u7406\u89e3\u4e86\u5c0f\u7a0b\u5e8f\u7684\u4ea7\u54c1\u5b9a\u4f4d\u540e\uff0c\u6211\u53d1\u73b0<strong>\u53cc\u7ebf\u7a0b\u6a21\u578b\u662f\u5728\u5c0f\u7a0b\u5e8f\u8fd9\u7c7b\u4ea7\u54c1\u573a\u666f\u4e0b\u7684\u6700\u4f18\u89e3<\/strong>\u3002\u90a3\u5c0f\u7a0b\u5e8f\u662f\u4e00\u6b3e\u4ec0\u4e48\u6837\u7684\u4ea7\u54c1\u5462\uff1f<\/p>\n<p>\u5c0f\u7a0b\u5e8f\u7684\u5bbf\u4e3b\u662f\u5fae\u4fe1\uff0c\u4f46\u662f\u5c0f\u7a0b\u5e8f\u7248\u672c\u7684\u8fed\u4ee3\u662f\u72ec\u7acb\u7684\uff0c\u5347\u7ea7\u66f4\u65b0\u4e0d\u4f9d\u8d56\u5bbf\u4e3b\uff0c\u8fd9\u4e00\u70b9\u8ddf Web \u7f51\u7ad9\u662f\u76f8\u540c\u7684\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5c0f\u7a0b\u5e8f\u6cbf\u88ad\u4e86 Web \u7684\u67d0\u4e9b\u4f18\u52bf\uff0c\u4f46\u5b83\u5e76\u4e0d\u662f Web\uff0c\u76ee\u524d Web \u76f8\u5173\u7684\u6280\u672f\u5df2\u7ecf\u76f8\u5f53\u5168\u9762\uff0c\u80fd\u591f\u627f\u8f7d\u4e00\u4e9b\u975e\u5e38\u5e9e\u5927\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u6bd4\u5982 3D \u5730\u56fe\u3001\u6e38\u620f\u7b49\u3002<\/p>\n<p>\u800c\u5c0f\u7a0b\u5e8f\u7684\u5b9a\u4f4d\u662f\u5c0f\u800c\u7f8e\u3001\u7528\u5b8c\u5c31\u8d70\uff0c\u4e0d\u8ffd\u6c42\u5728\u5fae\u4fe1\u4e2d\u5b9e\u73b0\u5168\u90e8\u7684 Web \u80fd\u529b\uff0c\u6240\u4ee5\u548c Web \u6765\u6bd4\u80fd\u529b\u4e0a\u80af\u5b9a\u5dee\u4e00\u4e9b\uff0c\u540c\u65f6\u5177\u5907\u4e00\u4e9b\u5fae\u4fe1\u63d0\u4f9b\u7684\u539f\u751f\u80fd\u529b\uff0c\u6bd4\u5982\u539f\u751f\u7ec4\u4ef6\u3001\u7cfb\u7edf\u7ea7\u522b\u548c\u5fae\u4fe1\u751f\u6001\u7684 API \u7b49\u7b49\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u201c\u5c0f\u7a0b\u5e8f-\u5fae\u4fe1\u201d\u7684\u5173\u7cfb\u8ddf\u201c\u7f51\u7ad9-\u6d4f\u89c8\u5668\u201d\u7684\u5173\u7cfb\u4e0d\u540c\uff0c\u524d\u8005\u66f4\u63a5\u8fd1 CodePen\u3001JSFiddler \u8fd9\u7c7b\u5728\u7ebf\u7f16\u7a0b\u5e73\u53f0\uff08\u8bfe\u91cc\u7b80\u79f0\u5e73\u53f0\uff09\u4e2d\u6bcf\u4e2a\u7a0b\u5e8f\u6848\u4f8b\uff08\u7b80\u79f0\u6848\u4f8b\uff09\u4e0e\u5e73\u53f0\u7684\u5173\u7cfb\u3002<\/p>\n<p>\u4ece\u6280\u672f\u7684\u89d2\u5ea6\u4e0a\uff0c\u5e73\u53f0\u6700\u6838\u5fc3\u7684\u4e00\u4e2a\u8003\u91cf\u70b9\u662f\u4e3a\u6848\u4f8b\u63d0\u4f9b\u8db3\u591f\u80fd\u529b\u7684\u524d\u63d0\u4e0b\uff0c<strong>\u4fdd\u8bc1\u6848\u4f8b\u7684\u903b\u8f91\u4e0d\u4f1a\u5371\u53ca\u5e73\u53f0\u7684\u5b89\u5168<\/strong>\u3002\u60f3\u8c61\u4e00\u4e0b\uff0c\u5047\u5982\u4f60\u80fd\u591f\u5728 CodePen \u4e0a\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\u6765\u83b7\u53d6 CodePen \u7684\u79c1\u5bc6\u4fe1\u606f\uff0c\u53ef\u80fd\u7b2c\u4e8c\u5929 CodePen \u5c31\u5d29\u6e83\u7136\u540e\u7092\u6389\u6240\u6709\u5458\u5de5\u3002<\/p>\n<p>\u5728\u8fd9\u6837\u7684\u4ea7\u54c1\u57fa\u8c03\u4e0b\u8fdb\u884c\u6280\u672f\u9009\u578b\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u67b6\u6784\u5e08\u548c\u7a0b\u5e8f\u5458\u7684\u5de5\u4f5c\u4e86\u3002<\/p>\n<p><strong>\u8fd8\u662f\u4ee5 CodePen \u4e3a\u4f8b\uff0c\u5047\u5982\u8ba9\u4f60\u6765\u8bbe\u8ba1\u8fd9\u6837\u7684\u7f16\u7a0b\u5e73\u53f0\uff0c\u4f60\u4f1a\u7528\u4ec0\u4e48\u6280\u672f\u5462\uff1f<\/strong>\u53ef\u80fd\u4f60\u7b2c\u4e00\u4e2a\u60f3\u5230\u7684\u662f\u7528 iframe\uff0c\u56e0\u4e3a\u53ef\u4ee5\u5728 iframe \u5185\u4f7f\u7528\u5168\u90e8 Web \u80fd\u529b\u3002\u4e8b\u5b9e\u4e0a CodePen \u786e\u5b9e\u7528 iframe \u6765\u5448\u73b0\u7a0b\u5e8f\u7684\u6548\u679c\uff0c\u4f46\u662f\u5e76\u4e0d\u4f1a\u628a\u8f93\u5165\u7684 JavaScript \u4ee3\u7801\u5b8c\u5168\u62f7\u8d1d\u5230 iframe \u5185\u8fd0\u884c\uff0c\u800c\u662f\u4ee3\u7801\u4f1a\u7ecf\u8fc7\u4e00\u6b21\u7f16\u8bd1\u6d41\u7a0b\u4e4b\u540e\u624d\u4f1a\u88ab\u6ce8\u5165 iframe \u5185\u3002\u8fd9\u6837\u505a\u7684\u51fa\u53d1\u70b9\u4e3b\u8981\u662f\u57fa\u4e8e\u5b89\u5168\u7684\u8003\u8651\uff0c\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u5c06\u4e00\u4e9b\u5371\u9669\u7684\u4ee3\u7801\u5254\u9664\uff1b\u5176\u6b21\u8fd9\u6837\u505a\u8fd8\u80fd\u5728\u5e73\u53f0\u4e2d\u652f\u6301\u66f4\u591a\u8bed\u8a00\uff0c\u6bd4\u5982typescript\u3002\u5f53\u7136\uff0c\u8fd8\u6709\u6027\u80fd\uff0c\u6027\u80fd\u95ee\u9898\u662f iframe \u8001\u751f\u5e38\u8c08\u7684\u95ee\u9898\u4e86\uff0c\u6211\u5c31\u4e0d\u591a\u8bf4\u4e86\u3002<\/p>\n<p><strong>\u6240\u4ee5\uff0c\u4e0d\u4ec5\u8981\u4f7f\u7528 iframe\uff0c\u8fd8\u9700\u8981\u5f15\u5165\u989d\u5916\u7684 JavaScript \u7f16\u8bd1\u5668<\/strong>\u3002CodePen \u4e00\u5b9a\u8981\u4fdd\u8bc1\u6bcf\u4e2a\u6848\u4f8b\u7684 JavaScript \u4ee3\u7801\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u6700\u57fa\u672c\u7684\u5c31\u662f\u8981\u7981\u6b62\u7a0b\u5e8f\u64cd\u4f5cCodePen \u7f51\u7ad9\u7684 DOM \uff0c\u5b9e\u73b0\u8fd9\u4e00\u70b9\u6709\u4e24\u4e2a\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li>\n<p>\u4e00\u4e2a\u662f Web Worker\uff1b<\/p>\n<\/li>\n<li>\n<p>\u53e6\u4e00\u4e2a\u662f\u4f7f\u7528 Shadow DOM\u3002<\/p>\n<\/li>\n<\/ul>\n<p>Web Worker \u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0cWorker \u5185\u7684 JavaScript \u4ee3\u7801\u65e0\u6cd5\u83b7\u53d6 Window \u548c Document \u5bf9\u8c61\uff0c\u4e5f\u5c31\u65e0\u6cd5\u64cd\u4f5c DOM\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u7531\u4e8e Worker \u7684\u7ebf\u7a0b\u5b89\u5168\u7279\u6027\uff0cWorker \u5185\u7684\u4ee3\u7801\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u963b\u585e\u5916\u5c42\u7684 GUI \u6e32\u67d3\u7ebf\u7a0b\uff0c\u4e24\u8005\u53ef\u4ee5\u5e76\u884c\u3002<\/p>\n<p>Shadow DOM \u662f Web Components \u89c4\u8303\u7684\u4e00\u90e8\u5206\uff0c\u5c06 ShadowRoot \u7684\u6a21\u5f0f\u8bbe\u7f6e\u4e3a closed \u5c31\u53ef\u4ee5\u7981\u6b62\u83b7\u53d6\u5230 ShadowRoot \u8282\u70b9\uff0c\u4ece\u800c\u4e5f\u65e0\u6cd5\u64cd\u4f5c\u5176\u5185\u90e8\u7684 DOM\u3002<\/p>\n<p>\u4e24\u8005\u76f8\u6bd4\uff0cShadow DOM \u7684\u517c\u5bb9\u6027\u6bd4 Web Worker \u66f4\u5dee\uff0c\u8ddd\u5927\u89c4\u6a21\u4f7f\u7528\u7684\u65e5\u671f\u8fd8\u5f88\u9065\u8fdc\uff0c\u6240\u4ee5 Web Worker \u7684\u65b9\u6848\u66f4\u73b0\u5b9e\u4e00\u70b9\u3002<\/p>\n<p>\u8fd9\u6837\u5c31\u5f62\u6210\u4e86\u4e00\u4e2a\u7b80\u6613\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\uff1aWorker \u7ebf\u7a0b\u8d1f\u8d23\u8ba1\u7b97\uff0c\u5c06\u7ed3\u679c\u901a\u8fc7 postMessage \u4f20\u9012\u7ed9\u4e3b\u7ebf\u7a0b\uff0c\u4e3b\u7ebf\u7a0b\u8d1f\u8d23\u6e32\u67d3\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/024\/5e3d9b1ba152584629d46ceb941a80cf-2.png\" class=\"aligncenter\" title=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe3\" alt=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe3\" \/><\/p>\n<p>\u4f46\u662f\u8fd9\u4e2a\u6a21\u578b\u5b58\u5728\u6bd4\u8f83\u4e25\u91cd\u7684\u6027\u80fd\u95ee\u9898\uff0cWeb Worker \u975e\u5e38\u8017\u8d39\u8d44\u6e90\uff0c\u9664\u53bb\u8ba1\u7b97\u6d88\u8017\u4ee5\u5916\uff0c\u4e0e\u4e3b\u7ebf\u7a0b\u7684\u901a\u4fe1\u8fc7\u7a0b\u5bf9\u6027\u80fd\u7684\u635f\u8017\u4e5f\u975e\u5e38\u4e25\u91cd\u3002<\/p>\n<p>\u90a3\u6709\u6ca1\u6709\u529e\u6cd5\u5b9e\u73b0\u8ddf Web Worker \u4e00\u6837\u7684\u7ebf\u7a0b\u5b89\u5168\uff0c\u540c\u65f6\u53c8\u517c\u987e\u6027\u80fd\u4fdd\u8bc1\u826f\u597d\u7684\u7528\u6237\u4f53\u9a8c\u5462\uff1f\u8fd9\u4fbf\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u91c7\u7528\u53cc\u7ebf\u7a0b\u6a21\u578b\u7684\u4e3b\u8981\u76ee\u7684\u3002<\/p>\n<h2>\u5b89\u5168\u9ad8\u6548\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b<\/h2>\n<p>\u867d\u7136\u524d\u9762\u7528\u4e86 CodePen \u8fd9\u7c7b\u7f16\u7a0b\u5e73\u53f0\u505a\u7c7b\u6bd4\uff0c\u4f46\u5c0f\u7a0b\u5e8f\u4e0e CodePen \u7684\u6280\u672f\u9700\u6c42\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\uff0c\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u5c0f\u7a0b\u5e8f\u5e76\u4e0d\u9700\u8981\u652f\u6301\u6240\u6709\u7684 HTML \u6807\u7b7e\uff0c\u53ea\u63d0\u4f9b\u6709\u9650\u7684\u51e0\u7c7b UI \u7ec4\u4ef6\uff0c\u6839\u636e\u5c0f\u7a0b\u5e8f\u4ea7\u54c1\u5b9a\u4f4d\uff0c\u6211\u4eec\u53ef\u4ee5\u5f52\u7eb3\u51fa\u5c0f\u7a0b\u5e8f\u7684\u4e3b\u8981\u6280\u672f\u9700\u6c42\u53ef\u4ee5\u5f52\u7eb3\u4e3a\u4e0b\u9762\u8fd9\u6837\u51e0\u70b9\u3002\uff08\u4efb\u4f55\u65b0\u6280\u672f\u6216\u67b6\u6784\u90fd\u662f\u4e3a\u4e86\u89e3\u51b3\u7279\u5b9a\u7684\u95ee\u9898\uff0c\u6240\u4ee5\u6709\u5fc5\u8981\u4e86\u89e3\u5c0f\u7a0b\u5e8f\u7684\u4e3b\u8981\u6280\u672f\u9700\u6c42\u3002\uff09<\/p>\n<ul>\n<li>\n<p><strong>\u9650\u5236 UI \u7ec4\u4ef6\u7c7b\u578b\uff0c\u53ea\u5141\u8bb8\u58f0\u660e\u6307\u5b9a\u7684\u51e0\u4e2a\u7ec4\u4ef6<\/strong><\/p>\n<p>\u5c0f\u7a0b\u5e8f\u5728\u58f0\u660e\u7ec4\u4ef6\u65f6\u5e76\u4e0d\u662f\u4f7f\u7528\u539f\u751f\u7684 HTML \u6807\u7b7e\uff0c\u800c\u662f\u53ea\u80fd\u591f\u901a\u8fc7\u5fae\u4fe1\u63d0\u4f9b\u7684\u51e0\u79cd\u5185\u7f6e\u57fa\u7840\u7ec4\u4ef6\uff0c\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u7ec4\u4ef6\uff0c\u4f46\u4e5f\u662f\u901a\u8fc7\u5bf9\u5185\u7f6e\u57fa\u7840\u7ec4\u4ef6\u7684\u7ec4\u5408\u6765\u5b9e\u73b0\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u8bc1\u903b\u8f91\u7ebf\u7a0b\u5b89\u5168\uff0c\u4e0d\u5141\u8bb8\u76f4\u63a5\u64cd\u4f5c UI \u7ec4\u4ef6<\/strong><\/p>\n<p>\u5c0f\u7a0b\u5e8f\u66f4\u65b0 UI \u7684\u65b9\u5f0f\u4e0e Vue\/React \u7b49 MVVM \u6846\u67b6\u7c7b\u4f3c\uff0cJavaScript \u4ee3\u7801\u4e0d\u80fd\u76f4\u63a5\u64cd\u4f5c DOM\uff08\u4ec5\u505a\u7c7b\u6bd4\uff0c\u4e8b\u5b9e\u4e0a\u5c0f\u7a0b\u5e8f\u4e2d\u6ca1\u6709DOM\u7684\u6982\u5ff5\uff09\uff0c\u800c\u662f\u901a\u8fc7\u66f4\u65b0\u72b6\u6001\uff08 setState \uff09\u7684\u65b9\u5f0f\u5f02\u6b65\u66f4\u65b0 UI \uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u4f1a\u7528\u5230 VDOM \u548c\u9ad8\u6548\u7684 diff \u7b97\u6cd5\uff08\u8fd9\u4e24\u70b9\u5e76\u4e0d\u662f\u6211\u4eec\u8981\u8ba8\u8bba\u7684\u5185\u5bb9\uff0c\u4f60\u8bfe\u4e0b\u53ef\u4ee5\u81ea\u5df1\u641c\u7d22\u76f8\u5173\u8d44\u6599\uff09\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u80fd\u591f\u5728\u7ebf\u66f4\u65b0\uff0c\u4e0d\u4f9d\u8d56\u5fae\u4fe1<\/strong><\/p>\n<p>\u5c0f\u7a0b\u5e8f\u7684\u5bbf\u4e3b\u662f\u5fae\u4fe1\uff0c\u5982\u679c\u4f7f\u7528\u7eaf Native \u5b9e\u73b0\uff0c\u90a3\u4e48\u5c0f\u7a0b\u5e8f\u7684\u7248\u672c\u66f4\u65b0\u5fc5\u987b\u4f9d\u8d56\u5fae\u4fe1\uff0c\u8ddf\u5fae\u4fe1\u7684\u4ee3\u7801\u4e00\u8d77\u53d1\u7248\uff0c\u8fd9\u6837\u80af\u5b9a\u662f\u4e0d\u884c\u7684\u3002\u5982\u679c\u662f\u7eaf Web \u5b9e\u73b0\uff0c\u5b89\u5168\u548c\u6027\u80fd\u5c31\u5f88\u96be\u5f97\u5230\u4fdd\u969c\u3002<\/p>\n<p>\u5c0f\u7a0b\u5e8f\u9700\u8981\u65e2\u80fd\u591f\u50cf Web \u4e00\u6837\u5c06\u8d44\u6e90\u6258\u7ba1\u5728\u4e91\u7aef\uff0c\u66f4\u65b0\u72ec\u7acb\uff1b\u540c\u65f6\u53c8\u80fd\u591f\u4fdd\u8bc1\u8db3\u591f\u597d\u7684\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002\u6240\u4ee5\u6700\u7ec8\u5c0f\u7a0b\u5e8f\u91c7\u7528\u4e86\u4e00\u79cd\u6df7\u5408\u7684\u67b6\u6784\u6a21\u5f0f\uff1a<strong>\u4f7f\u7528 Webview \u6e32\u67d3 UI\u3001\u4f7f\u7528\u7c7b\u4f3cWeb Worker \u7684\u72ec\u7acb\u7ebf\u7a0b\u8fd0\u884c\u903b\u8f91\uff0c<\/strong>\u8fd9\u5c31\u662f\u53cc\u7ebf\u7a0b\u6a21\u578b<strong>\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u6027\u80fd\u9700\u5c3d\u91cf\u63d0\u5347\uff0c\u4fdd\u8bc1\u7528\u6237\u4f53\u9a8c<\/strong><\/p>\n<p>\u524d\u9762\u63d0\u5230\u7684\u57fa\u4e8e Web Worker \u7684\u7b80\u6613\u53cc\u7ebf\u7a0b\u6a21\u578b\u6027\u80fd\u662f\u5f88\u5927\u7684\u95ee\u9898\uff0c\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u5e76\u4e0d\u662f\u4f7f\u7528 Web Worker \u5b50\u7ebf\u7a0b\uff0c\u800c\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u201c\u4e3b\u7ebf\u7a0b\u201d\uff0c\u8fd9\u6837\u80fd\u591f\u4fdd\u8bc1\u76f8\u5bf9\u8f83\u597d\u7684\u6027\u80fd\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>\u6e32\u67d3\u7ebf\u7a0b\u548c\u903b\u8f91\u7ebf\u7a0b<\/h3>\n<p>\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6307\u7684\u5c31\u662f\u6e32\u67d3\u7ebf\u7a0b\u548c\u903b\u8f91\u7ebf\u7a0b\uff0c\u8fd9\u4e24\u4e2a\u7ebf\u7a0b\u5206\u522b\u627f\u62c5UI\u7684\u6e32\u67d3\u548c\u6267\u884c JavaScript \u4ee3\u7801\u7684\u5de5\u4f5c\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/024\/19402e3d6298cdb5d9cd18f37cb83ce2-3.png\" class=\"aligncenter\" title=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe4\" alt=\"\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u63d2\u56fe4\" \/><\/p>\n<p>\u6e32\u67d3\u7ebf\u7a0b\u4f7f\u7528 Webview \u8fdb\u884c UI \u7684\u6e32\u67d3\u5448\u73b0\u3002Webview \u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u7c7b\u6d4f\u89c8\u5668\u8fd0\u884c\u73af\u5883\uff0c\u672c\u8eab\u5177\u5907\u8fd0\u884c JavaScript \u7684\u80fd\u529b\uff0c\u4f46\u662f\u5c0f\u7a0b\u5e8f\u5e76\u4e0d\u662f\u5c06\u903b\u8f91\u811a\u672c\u653e\u5230 Webview \u4e2d\u8fd0\u884c\uff0c\u800c\u662f\u5c06\u903b\u8f91\u5c42\u72ec\u7acb\u4e3a\u4e00\u4e2a\u4e0e Webview \u5e73\u884c\u7684\u7ebf\u7a0b\uff0c\u4f7f\u7528\u5ba2\u6237\u7aef\u63d0\u4f9b\u7684 JavaScript \u5f15\u64ce\u8fd0\u884c\u4ee3\u7801\uff0ciOS \u7684JavaScriptCore\u3001\u5b89\u5353\u662f\u817e\u8baf X5 \u5185\u6838\u63d0\u4f9b\u7684 JsCore \u73af\u5883\u4ee5\u53ca IDE \u5de5\u5177\u7684 nwjs \u3002<\/p>\n<p>\u903b\u8f91\u7ebf\u7a0b\u662f\u4e00\u4e2a\u53ea\u80fd\u591f\u8fd0\u884c JavaScript \u7684\u6c99\u7bb1\u73af\u5883\uff0c\u4e0d\u63d0\u4f9b DOM \u64cd\u4f5c\u76f8\u5173\u7684 API\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u64cd\u4f5c UI\uff0c\u53ea\u80fd\u591f\u901a\u8fc7 setData \u66f4\u65b0\u6570\u636e\u7684\u65b9\u5f0f\u5f02\u6b65\u66f4\u65b0 UI\u3002<\/p>\n<p><strong><span style=\"font-size: 18px\">\u4e8b\u4ef6\u9a71\u52a8\u7684\u901a\u4fe1\u65b9\u5f0f<\/span><\/strong><\/p>\n<p>\u6ce8\u610f\u4e0a\u56fe\u6e32\u67d3\u7ebf\u7a0b\u548c\u903b\u8f91\u7ebf\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1\u65b9\u5f0f\uff0c\u4e0e Vue\/React \u4e0d\u540c\u7684\u662f\uff0c\u5c0f\u7a0b\u5e8f\u7684\u6e32\u67d3\u5c42\u4e0e\u903b\u8f91\u5c42\u4e4b\u95f4\u7684\u901a\u4fe1\u5e76\u4e0d\u662f\u5728\u4e24\u8005\u4e4b\u95f4\u76f4\u63a5\u4f20\u9012\u6570\u636e\u6216\u4e8b\u4ef6\uff0c\u800c\u662f<strong>\u7531 Native \u4f5c\u4e3a\u4e2d\u95f4\u5a92\u4ecb\u8fdb\u884c\u8f6c\u53d1<\/strong>\u3002<\/p>\n<p><strong>\u6574\u4e2a\u8fc7\u7a0b\u662f\u5178\u578b\u7684\u4e8b\u4ef6\u9a71\u52a8\u6a21\u5f0f\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u6e32\u67d3\u5c42\uff08\u4e5f\u53ef\u4ee5\u79f0\u4e3a\u89c6\u56fe\u5c42\uff09\u901a\u8fc7\u4e0e\u7528\u6237\u7684\u4ea4\u4e92\u89e6\u53d1\u7279\u5b9a\u7684\u4e8b\u4ef6 event\uff1b<\/p>\n<\/li>\n<li>\n<p>\u7136\u540e event \u88ab\u4f20\u9012\u7ed9\u903b\u8f91\u5c42\uff1b<\/p>\n<\/li>\n<li>\n<p>\u903b\u8f91\u5c42\u7ee7\u800c\u901a\u8fc7\u4e00\u7cfb\u5217\u7684\u903b\u8f91\u5904\u7406\u3001\u6570\u636e\u8bf7\u6c42\u3001\u63a5\u53e3\u8c03\u7528\u7b49\u884c\u4e3a\u5c06\u52a0\u5de5\u597d\u7684\u6570\u636e data \u4f20\u9012\u7ed9\u6e32\u67d3\u5c42\uff1b<\/p>\n<\/li>\n<li>\n<p>\u6700\u540e\u6e32\u67d3\u5c42\u5c06 data \u6e32\u67d3\u4e3a\u53ef\u89c6\u5316\u7684 UI\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u6570\u636e\u9a71\u52a8 UI \u7684\u6a21\u5f0f\u662f\u73b0\u5728\u524d\u7aef\u7f16\u7a0b\u9886\u57df\u8f83\u4e3a\u63a8\u5d07\u7684\u7f16\u7a0b\u8303\u5f0f\uff0c\u5982\u679c\u4f60\u662f\u4e00\u4e2a\u8d85\u8fc7 5 \u5e74\u5f00\u53d1\u7ecf\u9a8c\u7684\u524d\u7aef\u5f00\u53d1\u8005\u7684\u8bdd\uff0c\u90a3\u4e48\u6211\u76f8\u4fe1\u5728\u6700\u521d\u63a5\u89e6\u5230\u8fd9\u79cd\u6a21\u5f0f\u7684\u65f6\u5019\u80af\u5b9a\u6709\u4e00\u4e9b\u4e0d\u9002\u5e94\uff0c\u56e0\u4e3a\u5728\u6b64\u4e4b\u524d JavaScript \u64cd\u4f5c DOM \u51e0\u4e4e\u662f\u4e00\u79cd\u201c\u4e1a\u5185\u89c4\u5219\u201d\uff0c\u751a\u81f3\u6709\u4e0d\u5c11\u9488\u5bf9\u524d\u7aef\u5165\u95e8\u7684\u56fe\u4e66\u3001\u535a\u5ba2\u548c\u6559\u6750\u90fd\u662f\u5148\u4ece DOM \u64cd\u4f5c\u8bb2\u8d77\uff0c\u73b0\u5728\u770b\u6765\u8fd9\u4e9b\u786e\u5b9e\u6709\u4e9b\u4e0d\u5408\u65f6\u5b9c\u4e86\u3002<\/p>\n<p>\u800c\u8fd9\u6837\u903b\u8f91\u4e0e\u6e32\u67d3\u5206\u79bb\u7684\u7ebf\u7a0b\u5206\u5de5\u6a21\u5f0f\u4e00\u65b9\u9762\u80fd\u591f\u4fdd\u8bc1\u8fd0\u884c\u5728\u903b\u8f91\u7ebf\u7a0b\u6c99\u7bb1\u5185\u7684 JavaScript \u4ee3\u7801\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u53e6\u4e00\u65b9\u9762\u7531\u4e8e\u6e32\u67d3\u7ebf\u7a0b\u7684\u8ba1\u7b97\u91cf\u975e\u5e38\u5c0f\u4ece\u800c\u4fdd\u8bc1\u4e86\u5bf9\u7528\u6237\u4ea4\u4e92\u884c\u4e3a\u7684\u5feb\u901f\u54cd\u5e94\uff0c\u63d0\u9ad8\u4e86\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<p>\u603b\u7684\u6765\u8bf4\uff0c\u8ddf\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\u76f8\u6bd4\uff0c\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u89e3\u51b3\u4e86\u6216\u8005\u8bf4\u89c4\u907f\u4e86 Web Worker \u582a\u5fe7\u7684\u6027\u80fd\u540c\u65f6\u53c8\u5b9e\u73b0\u4e86\u4e0e Web Worker \u76f8\u540c\u7684\u7ebf\u7a0b\u5b89\u5168\uff0c\u4ece\u6027\u80fd\u548c\u5b89\u5168\u4e24\u4e2a\u89d2\u5ea6\u5b9e\u73b0\u4e86\u63d0\u5347\u3002\u53ef\u4ee5\u6982\u62ec\u5730\u8bf4\uff0c<strong>\u53cc\u7ebf\u7a0b\u6a21\u5f0f\u662f\u53d7\u9650\u4e8e\u6d4f\u89c8\u5668\u73b0\u6709\u7684\u8fdb\u7a0b\u548c\u7ebf\u7a0b\u7ba1\u7406\u6a21\u5f0f\u4e4b\u4e0b\uff0c\u5728\u5c0f\u7a0b\u5e8f\u8fd9\u4e00\u5177\u4f53\u573a\u666f\u4e4b\u5185\u7684\u4e00\u79cd\u6539\u8fdb\u7684\u67b6\u6784\u65b9\u6848<\/strong>\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u5728\u6211\u770b\u6765\uff0c\u7a0b\u5e8f\u5458\u7684\u6838\u5fc3\u80fd\u529b\u548c\u7ade\u4e89\u529b\u5e76\u4e0d\u662f\u5145\u5206\u4e86\u89e3\u67d0\u79cd\u8bed\u8a00\u6216\u6846\u67b6\u7684 API \uff0c\u800c\u662f\u8fd9\u4e9b\u8bed\u8a00\u548c\u6846\u67b6\u5e95\u5c42\u7684\u539f\u7406\u77e5\u8bc6\u3002\u5bf9\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u5728\u5de5\u4f5c\u4e2d\u9047\u5230\u6280\u672f\u96be\u9898\u65f6\u7684\u89e3\u51b3\u65b9\u6848\u5f80\u5f80\u662f\u57fa\u4e8e\u5e95\u5c42\u539f\u7406\u7684\uff08\u751a\u81f3\u66f4\u76f4\u767d\u4e00\u70b9\uff0c\u5f53\u4f60\u627e\u5de5\u4f5c\u9762\u8bd5\u65f6\uff0c\u6ca1\u4eba\u4f1a\u95ee\u4f60\u5c0f\u7a0b\u5e8f\u7684\u8bed\u6cd5\uff09\u3002<\/p>\n<p>\u901a\u8fc7\u4e86\u89e3\u5c0f\u7a0b\u5e8f\u53cc\u7ebf\u7a0b\u6a21\u578b\u7684\u80cc\u666f\u3001\u8bbe\u8ba1\u3001\u901a\u4fe1\uff0c\u5e0c\u671b\u80fd\u591f\u8ba9\u5927\u5bb6\u66f4\u6df1\u5165\u5730\u7406\u89e3\u5c0f\u7a0b\u5e8f\u7684\u5e95\u5c42\u67b6\u6784\uff0c\u5982\u679c\u5728\u540e\u7eed\u5de5\u4f5c\u4e2d\u6709\u7c7b\u4f3c\u573a\u666f\u7684\u9700\u6c42\u4e5f\u53ef\u4ee5\u4f5c\u4e3a\u501f\u9274\u3002\u5f53\u7136\uff0c\u4e86\u89e3\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u5e76\u4e0d\u662f\u552f\u4e00\u7684\u76ee\u6807\uff0c\u8fd9\u4e9b\u77e5\u8bc6\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u80fd\u5bf9\u65e5\u5e38\u5f00\u53d1\u5de5\u4f5c\u4ea7\u751f\u4e00\u4e9b\u542f\u793a\uff0c\u4e3b\u8981\u662f\u6027\u80fd\u65b9\u9762\uff1a<\/p>\n<ul>\n<li>\n<p>\u5728\u4fdd\u8bc1\u529f\u80fd\u7684\u524d\u63d0\u4e0b\u5c3d\u91cf\u4f7f\u7528\u7ed3\u6784\u7b80\u5355\u7684 UI\uff1b<\/p>\n<\/li>\n<li>\n<p>\u5c3d\u91cf\u964d\u4f4e JavaScript \u903b\u8f91\u7684\u590d\u6742\u5ea6\uff1b<\/p>\n<\/li>\n<li>\n<p>\u5c3d\u91cf\u51cf\u5c11 setData \u7684\u8c03\u7528\u9891\u6b21\u548c\u643a\u5e26\u7684\u6570\u636e\u4f53\u91cf\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u66f4\u591a\u7f16\u7a0b\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u8bbf\u95ee\uff1a\uff01\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6df1\u5165\u89e3\u6790\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\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>\u672c\u7bc7\u6587\u7ae0\u5e26\u5927\u5bb6\u7406\u89e3\u4e00\u4e0b\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\uff0c\u804a\u804a\u4ec0\u4e48\u662f\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\uff1f\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e0d\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\uff0c\u800c\u4f7f\u7528\u53cc\u7ebf\u7a0b\u6a21\u578b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff01 \u6709\u8fc7\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u7ecf\u9a8c\u7684\u670b\u53cb\u5e94\u8be5\u90fd\u77e5\u9053\u201c\u53cc\u7ebf\u7a0b\u6a21\u578b\u201d\u8fd9\u4e2a\u6982\u5ff5\uff0c\u672c\u6587\u7b80\u5355\u68b3\u7406\u4e00\u4e0b\u53cc\u7ebf\u7a0b\u6a21\u578b\u7684\u4e00\u4e9b\u79d1\u666e\u77e5\u8bc6\uff0c\u5b66\u8bc6\u6d45\u8584\uff0c\u82e5\u6709\u9519\u8bef\u6b22\u8fce\u6307\u6b63\u3002 \u6211\u4ee5\u524d\u5c31\u804c\u4e8e\u300c\u5c0f\u7a0b\u5e8f\u00b7\u4e91\u5f00\u53d1\u300d\u56e2\u961f\uff0c\u5728\u5bf9\u5916\u7684\u4e00\u4e9b\u57f9\u8bad\u548c\u6280\u672f\u5206\u4eab\u91cc\u7ecf\u5e38\u88ab\u4eba\u95ee\u5230\u8fd9\u6837\u4e00\u4e2a\u95ee\u9898\uff1a\u201c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e0e Web \u7f51\u7ad9\u5728\u6280\u672f\u5c42\u9762\u7684\u4e3b\u8981\u533a\u522b\u662f\u4ec0\u4e48\uff1f\u201d\uff0c\u5728\u7f16\u7a0b\u8bed\u8a00\u548c\u8303\u5f0f\u4e0a\uff0c\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e0e Web \u524d\u7aef\u5f00\u53d1\u975e\u5e38\u76f8\u4f3c\uff08\u6bd4\u5982\u90fd\u7528 JavaScript \u8bed\u8a00\u3001\u4e0e HTML\/CSS \u975e\u5e38\u76f8\u4f3c\u7684 WXML\/WXSS \u7b49\uff09\uff0c\u53ef\u5b83\u5374\u6ca1\u6709\u76f4\u63a5\u7528\u539f\u751f\u7684\u524d\u7aef\u6280\u672f\u3002\u3010\u76f8\u5173\u5b66\u4e60\u63a8\u8350\uff1a\u3011 \u4e0e Web \u7f51\u7ad9\u76f8\u6bd4\uff0c\u4ee5\u5fae\u4fe1\u4e3a\u5bbf\u4e3b\u7684\u5c0f\u7a0b\u5e8f\u66f4\u9700\u8981\u8003\u8651\u5b89\u5168\u3001\u6027\u80fd\u7b49\u56e0\u7d20\uff0c\u4fdd\u969c\u5c0f\u7a0b\u5e8f\u4e0d\u4f1a\u5bf9\u5fae\u4fe1App\u672c\u8eab\u4ea7\u751f\u5b89\u5168\u9690\u60a3\uff0c\u540c\u65f6\u8981\u5c3d\u91cf\u8fbe\u5230\u63a5\u8fd1\u539f\u751f\u5e94\u7528\u7684\u6027\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u3002\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e0d\u76f4\u63a5\u7528\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\uff0c\u975e\u8981\u81ea\u5df1\u5f04\u4e00\u5957\u53cc\u7ebf\u7a0b\u6a21\u578b\u6700\u4e3b\u8981\u7684\u4e24\u4e2a\u539f\u56e0\u3002 \u90a3\u4ec0\u4e48\u662f\u5c0f\u7a0b\u5e8f\u7684\u53cc\u7ebf\u7a0b\u6a21\u578b\u5462\uff1f \u7406\u89e3\u4e00\u4e2a\u65b0\u6982\u5ff5\u6216\u6280\u672f\u7684\u6700\u597d\u7684\u65b9\u6cd5\u5c31\u662f\u7ed9\u5b83\u4e00\u4e2a\u53c2\u7167\u7269\uff0c\u6240\u4ee5\u8981\u641e\u6e05\u695a\u5c0f\u7a0b\u5e8f\u7684\u7ebf\u7a0b\u6a21\u578b\uff0c\u9996\u5148\u8981\u5bf9\u6d4f\u89c8\u5668\u7684\u7ebf\u7a0b\u6a21\u578b\u6709\u4e00\u5b9a\u7684\u4e86\u89e3\u3002 \u6d4f\u89c8\u5668\u662f\u591a\u8fdb\u7a0b\u7684 \u53ef\u80fd\u6bcf\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08\u5728\u521a\u5165\u884c\u7684\u65f6\u5019\u90fd\u4e0d\u6b62\u4e00\u6b21\u5730\u88ab\u9762\u8bd5\u5b98\u95ee\u5230\u201c\u600e\u4e48\u7406\u89e3\u524d\u7aef\u7684\u5355\u7ebf\u7a0b\uff1f\u201d\uff0c\u56e0\u4e3a\u524d\u7aef\u6838\u5fc3\u6280\u80fd\u4e4b\u4e00\u7684 JavaScript \u8bed\u8a00\u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u5145\u5206\u7406\u89e3\u5e76\u638c\u63e1JS\u5355\u7ebf\u7a0b\u7684\u8fd0\u4f5c\u65b9\u5f0f\u5bf9\u4e00\u4e2a\u524d\u7aef\u5de5\u7a0b\u5e08\u6765\u8bf4\u662f\u6700\u57fa\u672c\u7684\u8981\u6c42\u3002\u4f46\u662f\u5f88\u591a\u521d\u5b66\u8005\u5bb9\u6613\u8d70\u5165\u7684\u4e00\u4e2a\u8bef\u533a\uff1a\u9519\u8bef\u5730\u628a \u201cJavaScript \u5355\u7ebf\u7a0b\u201d\u7406\u89e3\u4e3a\u201c\u6d4f\u89c8\u5668\u5355\u7ebf\u7a0b\u201d\u3002 \u4e8b\u5b9e\u4e0a\uff0c\u6d4f\u89c8\u5668\u5185\u90e8\u67b6\u6784\u5f88\u590d\u6742\uff0c\u53ea\u4e0d\u8fc7\u5728\u5904\u7406 GUI \u6e32\u67d3\u7ebf\u7a0b\u548c JavaScript \u903b\u8f91\u811a\u672c\u7ebf\u7a0b\u4e0a\u7528\u4e86\u4e92\u65a5\u3001\u963b\u585e\u7684\u7ba1\u7406\u6a21\u5f0f\uff0c\u8ba9\u4e00\u4e9b\u5f00\u53d1\u8005\u4ea7\u751f\u4e86\u8bef\u89e3\u3002 \u4ee5 Chrome \u6d4f\u89c8\u5668\u4e3a\u4f8b\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u8bbe\u7f6e\u6309\u94ae\u7136\u540e\u8fdb\u5165\u201c\u66f4\u591a\u5de5\u5177\u201d-&gt;\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d\u4f1a\u770b\u5230\u8fd9\u6837\u7684\u5f39\u7a97\uff1a \u80fd\u770b\u5230Chrome \u5f00\u542f\u4e86\u591a\u4e2a\u8fdb\u7a0b\uff0c\u5305\u62ec\u6d4f\u89c8\u5668\u8fdb\u7a0b\u3001\u7f51\u7edc\u8fdb\u7a0b\u3001GPU \u8fdb\u7a0b\u7b49\uff0c\u8fd9\u4e9b\u90fd\u662f\u901a\u7528\u7684\u8fdb\u7a0b\u3002\u8bf7\u6ce8\u610f\uff0c\u4e0a\u56fe\u91cc\u6709\u4e24\u4e2a\u6807\u7b7e\u9875\u8fdb\u7a0b\uff0cChrome \u4e3a\u6bcf\u4e2a\u6807\u7b7e\u9875\u5f00\u542f\u4e86\u4e00\u4e2a\u72ec\u7acb\u7684\u6e32\u67d3\u8fdb\u7a0b\uff08 Renderer Process \uff09\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u8d44\u6e90\uff08 CPU\u3001\u5185\u5b58\u7b49\uff09\u548c\u884c\u4e3a\uff08 UI\u3001\u903b\u8f91\u7b49\uff09\u4e92\u4e0d\u5171\u4eab\uff0c\u6240\u4ee5\u5373\u4fbf\u67d0\u4e2a\u6807\u7b7e\u9875\u5d29\u6e83\u4e86\u4e5f\u4e0d\u4f1a\u5f71\u54cd\u5176\u4ed6\u6807\u7b7e\u9875\u3002 \u800c\u5728\u6bcf\u4e2a\u6807\u7b7e\u9875\u8fdb\u7a0b\u4e2d\uff0c\u6d4f\u89c8\u5668\u4f1a\u628a\u4e0d\u540c\u7684\u5de5\u4f5c\u4ea4\u7ed9\u5bf9\u5e94\u7684\u7ebf\u7a0b\uff0c\u6bd4\u5982 GUI \u6e32\u67d3\u7ebf\u7a0b\u8d1f\u8d23\u628a HTML \u6e32\u67d3\u6210\u53ef\u89c6\u5316\u7684 UI\uff1bJavaScript \u5f15\u64ce\u7ebf\u7a0b\u8d1f\u8d23\u89e3\u6790\u548c\u8fd0\u884c JavaScript \u4ee3\u7801\u903b\u8f91\uff1b\u5b9a\u65f6\u89e6\u53d1\u5668\u7ebf\u7a0b\u8d1f\u8d23\u5904\u7406 setTimeout\/setInterval \u5b9a\u65f6\u5668\u7b49\u3002 \u591a\u8bf4\u4e00\u53e5\uff0c\u8fd9\u91cc\u6709\u4e00\u4e2a\u5f88\u5bb9\u6613\u641e\u6df7\u7684\u5730\u65b9\uff0c\u5176\u5b9esetTimeout\/setInterval \u5e76\u4e0d\u662f JavaScript [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-34207","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/34207","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=34207"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/34207\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=34207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=34207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=34207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}