{"id":29819,"date":"2024-11-25T16:32:59","date_gmt":"2024-11-25T08:32:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/29819\/"},"modified":"2024-11-25T16:32:59","modified_gmt":"2024-11-25T08:32:59","slug":"%e6%95%99%e4%bd%a0%e5%a6%82%e4%bd%95%e4%bb%8e%e9%9b%b6%e5%bb%ba%e9%80%a0%e4%b8%80%e4%b8%aa%e5%b0%8f%e7%a8%8b%e5%ba%8f%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/29819\/","title":{"rendered":"\u6559\u4f60\u5982\u4f55\u4ece\u96f6\u5efa\u9020\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9879\u76ee"},"content":{"rendered":"<p>ide\u51c6\u5907<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1amp.weixin.qq.com\/debug\/wxadoc\/dev\/devtools\/download.html<\/p>\n<p>\u77e5\u8bc6\u51c6\u5907<\/p>\n<p>JavaScrip\u8fd8\u662f\u8981\u770b\u770b\u7684\uff0c\u63a8\u8350\u6559\u7a0b\uff1aJavaScript \u521d\u7ea7\u6559\u7a0b<\/p>\n<p>\u4ece\u96f6\u5f00\u59cb<\/p>\n<p>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5c31\u56db\u79cd\u7c7b\u578b\u7684\u6587\u4ef6<\/p>\n<p>js &#8212;&#8212;&#8212;- JavaScrip\u6587\u4ef6<\/p>\n<p>json &#8212;&#8212;&#8211; \u9879\u76ee\u914d\u7f6e\u6587\u4ef6\uff0c\u8d1f\u8d23\u7a97\u53e3\u989c\u8272\u7b49\u7b49<\/p>\n<p>wxml &#8212;&#8212;- \u7c7b\u4f3cHTML\u6587\u4ef6<\/p>\n<p>wxss &#8212;&#8212;- \u7c7b\u4f3cCSS\u6587\u4ef6<\/p>\n<p>\u5728\u6839\u76ee\u5f55\u4e0b\u7528app\u6765\u547d\u540d\u7684\u8fd9\u56db\u4e2d\u7c7b\u578b\u7684\u6587\u4ef6\uff0c\u5c31\u662f\u7a0b\u5e8f\u5165\u53e3\u6587\u4ef6\u3002<\/p>\n<p>app.json<\/p>\n<p>\u5fc5\u987b\u8981\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0cIDE\u4f1a\u62a5\u9519\uff0c\u56e0\u4e3a\u5fae\u4fe1\u6846\u67b6\u628a\u8fd9\u4e2a\u4f5c\u4e3a\u914d\u7f6e\u6587\u4ef6\u5165\u53e3\uff0c<\/p>\n<p>\u4f60\u53ea\u9700\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\uff0c\u91cc\u9762\u5199\u4e2a\u5927\u62ec\u53f7\u5c31\u884c<\/p>\n<p>\u4ee5\u540e\u6211\u4eec\u4f1a\u5728\u8fd9\u91cc\u5bf9\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\u3002\u8bb0\u5f55\u4e86\u9875\u9762\u7ec4\u6210\uff0c\u914d\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u7a97\u53e3 \u80cc\u666f\u8272\uff0c\u914d\u7f6e\u5bfc\u822a\u6761\u6837\u5f0f\uff0c\u914d\u7f6e\u9ed8\u8ba4\u6807\u9898\u3002<\/p>\n<p>app.js<\/p>\n<p>\u5fc5\u987b\u8981\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6ca1\u6709\u4e5f\u662f\u4f1a\u62a5\u9519\uff01\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u521b\u5efa\u4e00\u4e0b\u5c31\u884c \u4ec0\u4e48\u90fd\u4e0d\u9700\u8981\u5199<\/p>\n<p>\u4ee5\u540e\u6211\u4eec\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u76d1\u542c\u5e76\u5904\u7406\u5c0f\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u51fd\u6570\u3001\u58f0\u660e\u5168\u5c40\u53d8\u91cf\u3002<\/p>\n<p>app.wxss<\/p>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u4e0d\u662f\u5fc5\u987b\u7684\u3002\u56e0\u4e3a\u5b83\u53ea\u662f\u4e2a\u5168\u5c40CSS\u6837\u5f0f\u6587\u4ef6<\/p>\n<p>app.wxml<\/p>\n<p>\u8fd9\u4e2a\u4e5f\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u800c\u4e14\u8fd9\u4e2a\u5e76\u4e0d\u662f\u6307\u4e3b\u754c\u9762\u54e6~\u56e0\u4e3a\u5c0f\u7a0b\u5e8f\u7684\u4e3b\u9875\u9762\u662f\u9760\u5728JSON\u6587\u4ef6\u4e2d\u914d\u7f6e\u6765\u51b3\u5b9a\u7684<\/p>\n<p>\u6709\u4e86\u8fd9\u4e24\u4e2a\u6587\u4ef6\u4f60\u8fd0\u884c\u7a0b\u5e8f\uff0cIDE\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\uff0c\u4e5f\u610f\u5473\u7740\u8fd9\u662f\u6700\u7b80\u5355\u7684\u5fae\u4fe1\u5c0f\u7a0b\u5e8f<\/p>\n<p>\u521b\u5efa\u7a0b\u5e8f\u5b9e\u4f8bHello World<\/p>\n<p>app.js\u6587\u4ef6\u7ba1\u7406\u6574\u4e2a\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\uff0c\u6240\u4ee5\u5728\u91cc\u9762\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a\uff08\u8f93\u5165App IDE\u4f1a\u6709\u63d0\u793a\uff09<\/p>\n<p>App({&nbsp; onLaunch: function () {&nbsp; &nbsp; console.log(&#8216;App Launch&#8217;)&nbsp; },&nbsp; onShow: function () {&nbsp; &nbsp; console.log(&#8216;App Show&#8217;)&nbsp; },&nbsp; onHide: function () {&nbsp; &nbsp; console.log(&#8216;App Hide&#8217;)&nbsp; }})<\/p>\n<p>\u5177\u4f53API\u89e3\u91ca\u5982\u4e0b<\/p>\n<p>\u7f8e\u5316ActionBar<\/p>\n<p>json\u6587\u4ef6\u8d1f\u8d23\u914d\u7f6eActionBar\u989c\u8272\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u91cc\u9762\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\u5373\u53ef\uff0c\u4e0b\u56fe\u6709\u53c2\u6570\u8bf4\u660e\uff01<\/p>\n<p>Paste_Image.png<\/p>\n<p>Paste_Image.png<\/p>\n<p>{&nbsp; &nbsp; &#8220;window&#8221;:{&nbsp; &nbsp; &nbsp; &nbsp; &#8220;navigationBarBackgroundColor&#8221;: &#8220;#BBDEF8&#8221;,&nbsp; &nbsp; &nbsp; &nbsp; &#8220;navigationBarTitleText&#8221;: &#8220;Demo&#8221;,&nbsp; &nbsp; &nbsp; &nbsp; &#8220;navigationBarTextStyle&#8221;:&#8221;white&#8221;&nbsp; &nbsp; }}<\/p>\n<p>Paste_Image.png<\/p>\n<p>\u73b0\u5728\u770bActionBar\u662f\u4e0d\u662f\u50cf\u90a3\u4e48\u56de\u4e8b\u4e86\uff01\u597d\u63a5\u4e0b\u6765\u6211\u4eec\u7ee7\u7eed\u5199\u6211\u4eec\u7b2c\u4e00\u4e2a\u754c\u9762<\/p>\n<p>\u7f8e\u5316\u9875\u9762<\/p>\n<p>\u7f8e\u5316\u9875\u9762\u6211\u4eec\u7528\u5230\u4e86 wxml \u548c wxss\u6587\u4ef6<\/p>\n<p>\u4e3a\u4e86\u7a0b\u5e8f\u4ee3\u7801\u7ed3\u6784\u7b80\u6d01<\/p>\n<p>\u6211\u4eec\u9700\u8981\u5728\u8ddf\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u5939 \u540d\u5b57\u968f\u610f\uff0c\u6211\u4eec\u8fd9\u91cc\u53ebpages<\/p>\n<p>\u7136\u540e\u5728pages\u6587\u4ef6\u5939\u91cc\u518d\u521b\u5efa\u65b0\u6587\u4ef6\u5939 \u540d\u5b57\u968f\u610f \u8fd9\u91cc\u6211\u4eec\u53eb index<\/p>\n<p>\u7136\u540e\u6211\u4eec\u521b\u5efaindex.wxml\u6587\u4ef6\u7136\u540e\u5728\u91cc\u9762\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801<\/p>\n<p>Hellotext&gt;view&gt;<\/p>\n<p>\u7136\u540e\u521b\u5efaindex.wxss\u6587\u4ef6\u7136\u540e\u5728\u91cc\u9762\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801<\/p>\n<p>.window{&nbsp; color=#4995fa;}<\/p>\n<p>\u7136\u540e\u6211\u4eec\u521b\u5efa index.js\u6587\u4ef6<\/p>\n<p>\u5728\u6587\u4ef6\u4e2d\u8f93\u5165\u5982\u4e0b\u4ee3\u7801\uff08\u8f93\u5165Page IDE\u4f1a\u6709\u63d0\u793a\uff09<\/p>\n<p>\u51fd\u6570\u89e3\u91ca\u5982\u4e0b\uff1a<\/p>\n<p>Paste_Image.png<\/p>\n<p>\u914d\u7f6e\u9996\u9875<\/p>\n<p>Json\u6587\u4ef6\u8d1f\u8d23\u914d\u7f6e\u9875\u9762\u8def\u5f84<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u5728\u91cc\u9762\u52a0\u5165\u5982\u4e0b\u4ee3\u7801<\/p>\n<p>\u5176\u4e2dindex\u7684\u542b\u4e49 \u5176\u5b9e\u5c31\u662f\u6307index.js\u6587\u4ef6<\/p>\n<p>\u8fd9\u91cc\u9700\u8981\u8bf4\u660e\u4e00\u70b9 pages \u91cc\u9762\u7684\u8def\u5f84\u5176\u5b9e\u662f\u6307\u5411js\u6587\u4ef6\u7684<\/p>\n<p>\u5982\u679c\u4e00\u4e2a\u76ee\u5f55\u4e0b\u6ca1\u6709\u8be5\u540d\u79f0\u7684js\u6587\u4ef6\u662f\u4f1a\u62a5\u9519\u7684\uff01<\/p>\n<p>&#8220;pages&#8221;:[&nbsp; &#8220;pages\/index\/index&#8221;],<\/p>\n<p>\u5b8c\u6210\u4e86\uff01\u6211\u4eec\u6765\u8fd0\u884c\u7a0b\u5e8f\uff01<\/p>\n<p>\u8d85\u7ea7Hello World<\/p>\n<p>\u4e3a\u4e86\u5b66\u4e60\u4e8b\u4ef6\u7ed1\u5b9a\uff0c\u4ee5\u53ca\u5982\u4f55\u5c06\u6570\u636e\u5728\u9875\u9762\u4e0a\u66f4\u65b0<\/p>\n<p>\u6211\u4eec\u6765\u505a\u4e2a\u8d85\u7ea7Hello World\uff0c\u5c31\u662f\u6211\u70b9\u51fb\u6587\u5b57\uff0c\u80fd\u8ba9<\/p>\n<p>\u5b83\u53d8\u8272\uff01<\/p>\n<p>\u7ed1\u5b9a\u4e8b\u4ef6<\/p>\n<p>\u6211\u4eec\u6253\u5f00index.wxml \u5c06\u91cc\u9762\u4ee3\u7801\u6539\u6210\u8fd9\u6837<\/p>\n<p>Hellotext&gt;view&gt;<\/p>\n<p>\u5176\u5b9e\u4e5f\u5c31\u662f\u52a0\u4e86catchtap=&#8221;click&#8221;<\/p>\n<p>\u8fd9\u4e24\u4e2a\u5c5e\u6027\u662f\u4ec0\u4e48\u610f\u601d\u5462 \u522b\u7740\u6025 \u6211\u4f1a\u4e00\u4e00\u89e3\u91ca<\/p>\n<p>\u4e0a\u56fe\u5c55\u793a\u4e86\u4e8b\u4ef6\u7684\u4e00\u4e9b\u7684\u5c5e\u6027\u540d\u79f0\uff0c\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u7ea2\u6846\u6807\u6ce8\u8d77\u6765\u7684\u5185\u5bb9\uff0c\u533a\u5206\u51fa\u5192\u6ce1\u4e8b\u4ef6\u548c\u975e\u5192\u6ce1\u4e8b\u4ef6\uff0c\u5176\u5b9e\u5192\u6ce1\u4e8b\u4ef6\u5c31\u662f\u9700\u8981\u5f80\u4e0a\u9762\u4e00\u5c42\u5bb9\u5668\u4f20\u9012\u8fd9\u4e2a\u4e8b\u4ef6\u3002<\/p>\n<p>\u770b\u4e86\u8fd9\u56fe \u6211\u4eec\u518d\u6765\u770b catchtap=&#8221;click&#8221; \u7684\u542b\u4e49<\/p>\n<p>catch \u4ee3\u8868\u975e\u5192\u6ce1\u4e8b\u4ef6<\/p>\n<p>tap \u4ee3\u8868\u70b9\u51fb\u4e8b\u4ef6<\/p>\n<p>\u6240\u4ee5\u8fde\u5728\u4e00\u8d77\u5c31\u662f\u975e\u5192\u6ce1\u70b9\u51fb\u4e8b\u4ef6<\/p>\n<p>\u90a3\u540e\u9762\u90a3\u4e2aclick\u662f\u5565<\/p>\n<p>click \u5176\u5b9e\u53ea\u662f\u4e2a\u53d8\u91cf\u540d\u5b57<\/p>\n<p>\u6211\u4eec\u5728index.js\u9700\u8981\u7528\u8fd9\u4e2a\u540d\u5b57\u7ed1\u5b9a\u63a5\u6536\u4e8b\u4ef6\u7684\u51fd\u6570<\/p>\n<p>\u6211\u4eec\u6253\u5f00index.js<\/p>\n<p>\u7136\u540e\u6dfb\u52a0\u5982\u4e0b\u51fd\u6570<\/p>\n<p>click:function(){&nbsp; &nbsp; console.log(&#8220;\u70b9\u51fb\u4e86\u6587\u5b57&#8221;);&nbsp; },<\/p>\n<p>\u6dfb\u52a0\u5b8c\u540e\u4ee3\u7801\u957f\u8fd9\u6837 \u7ea2\u6846\u4e2d\u5c31\u662f \u6dfb\u52a0\u7684\u8fd9\u4e2a\u4ee3\u7801<\/p>\n<p>\u6240\u4ee5\u5176\u5b9e\u70b9\u51fb\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570 \u5c31\u662f catchtap=&#8221;click&#8221;<\/p>\n<p>\u4e2d\u7684 click \u540e\u9762\u52a0\u4e0a :function() \u6784\u6210\u7684<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u6765\u8fd0\u884c\u7a0b\u5e8f\u8bd5\u8bd5 \u7136\u540e\u70b9\u51fb\u6587\u5b57<\/p>\n<p>\u770b\u662f\u4e0d\u662f\u8c03\u7528\u4e86 click:function \u51fd\u6570 \u5e76\u4e14\u6253\u51fa\u4e86log<\/p>\n<p>\u597d\u63a5\u4e0b\u6765\u6211\u4eec\u5199\u70b9\u51fb\u4e00\u4e0b\u53d8\u8272\u7684\u903b\u8f91<\/p>\n<p>\u90a3\u5982\u4f55\u8ba9\u4e00\u4e2a\u6587\u5b57\u53d8\u8272\u5462\uff0c\u5f53\u7136\u662fcss<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u9700\u8981\u518dindex.wxss \u4e2d\u6dfb\u52a0\u4e00\u4e2a\u6837\u5f0f<\/p>\n<p>.window-red{&nbsp; &nbsp; color:#D23933;}<\/p>\n<p>\u7136\u540e\u6211\u4eec\u8fdb\u5165index.js\u6587\u4ef6<\/p>\n<p>\u4f60\u4f1a\u53d1\u73b0\u4ee3\u7801\u91cc\u9762\u6709\u4e2a data:{} \u5b83\u4e0d\u662fpage\u751f\u547d\u5468\u671f\u51fd\u6570<\/p>\n<p>\u5176\u5b9e\u4ed6\u662f\u4e2a\u53d8\u91cf\u7684\u6570\u7ec4\uff0c\u8fd9\u4e2a\u91cc\u9762\u7533\u8bf7\u7684\u53d8\u91cf\u90fd\u53ef\u4ee5\u5728 wxml\u4e2d\u4f7f\u7528<\/p>\n<p>\u6211\u4eec\u5728\u8fd9\u91cc\u7533\u8bf7\u4e00\u4e2acolor<\/p>\n<p>color\u7684\u503c\u5c31\u662findex.wxss\u4e2d\u7684\u6837\u5f0f\u540d\u79f0<\/p>\n<p>\u7136\u540e\u8fdb\u5165index.wxml\u4e2d,\u5c06class\u4e2d\u7684\u503c\u6539\u6210 {{color}}<\/p>\n<p>\u5176\u5b9e\u610f\u601d\u5c31\u662f \u5c06js\u6587\u4ef6\u4e2d\u53d8\u91cf color\u7684\u503c\u5728\u8fd9\u91cc\u4f7f\u7528<\/p>\n<p>\u4e5f\u5c31\u662f\u503c\u7b49\u4e8e window<\/p>\n<p>\u7136\u540e\u6211\u4eec\u518d\u56de\u5230index.js\u6587\u4ef6<\/p>\n<p>\u5728\u6700\u4e0a\u9762\u7533\u8bf7\u4e00\u4e2a\u53d8\u91cf\u63a7\u5236\u70b9\u51fb<\/p>\n<p>\u7136\u540e\u5728click:function() \u51fd\u6570\u4e2d\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801<\/p>\n<p>click:function(){&nbsp; &nbsp; console.log(&#8220;\u70b9\u51fb\u4e86\u6587\u5b57&#8221;);&nbsp; &nbsp; &nbsp; if(flag){&nbsp; &nbsp; &nbsp; &nbsp; color = &#8220;window-red&#8221;;&nbsp; &nbsp; &nbsp; &nbsp; flag = false;&nbsp; &nbsp; &nbsp; }else{&nbsp; &nbsp; &nbsp; &nbsp; color = &#8220;window&#8221;;&nbsp; &nbsp; &nbsp; &nbsp; flag = true;&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; this.setData({&nbsp; &nbsp; &nbsp; &nbsp; color&nbsp; &nbsp; &nbsp; });&nbsp; },<\/p>\n<p>\u4fee\u6539\u5b8c\u540e\u7684\u4ee3\u7801\u5982\u56fe<\/p>\n<p>\u5176\u5b9e\u5c31\u662f\u5728\u70b9\u51fb\u662f\u540e \u66f4\u6362color\u53d8\u91cf\u7684\u503c \u800c\u66f4\u6362\u7684\u8fd9\u4e2a\u503c\u5176\u5b9e\u5c31\u662f\u6837\u5f0f\u7684\u540d\u79f0<\/p>\n<p>\u66f4\u65b0\u754c\u9762\u6570\u636e<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u95ee\u9898 \u6211\u4eec\u66f4\u6362\u5b8c\u503c \u4f46\u662f\u5728wxml\u4e2d\u4e0d\u4f1a\u7acb\u5373\u751f\u6548<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8c03\u7528<\/p>\n<p>this.setData()\u65b9\u6cd5\u5c06\u503c\u540c\u6b65\u7ed9wxml \u8ba9\u5b83\u7acb\u5373\u751f\u6548<\/p>\n<p>\u597d\u4e86\u6211\u4eec\u8fd0\u884c\u7a0b\u5e8f \u70b9\u51fbHello \u770b\u770b\u662f\u4e0d\u662f\u70b9\u4e00\u4e0b \u53d8\u4e00\u4e0b\u989c\u8272\uff01<\/p>\n<p>\u6700\u540e\u518d\u8865\u5145\u4e00\u70b9 index\u76ee\u5f55\u4e0b\u4e5f\u662f\u53ef\u4ee5\u914d\u7f6e json\u6587\u4ef6\u7684<\/p>\n<p>\u4e5f\u5c31\u662f\u6bcf\u4e2a\u9875\u9762\u90fd\u53ef\u4ee5\u914d\u7f6e\u81ea\u5df1\u72ec\u7279\u7684actionbar\u989c\u8272\u7b49\u7b49<\/p>\n<p>\u8fd9\u91cc\u7684\u914d\u7f6e\u4f1a\u8986\u76d6 app.json\u6587\u4ef6\u7684\u914d\u7f6e<\/p>\n<p>\u6e90\u7801github \u5730\u5740https:\/\/github.com\/pwh0996\/WXDemo.git<\/p>\n<p>\u6700\u540e\u5206\u4eab\u4e00\u6ce2\u5c0f\u7a0b\u5e8f\u6e90\u7801\uff0c488\u4e2a\u5c0f\u7a0b\u5e8fdemo\u6e90\u7801\u4e0b\u8f7d\u4e13\u533a\uff1a<\/p>\n<p>p\/36fc7213b5d0<\/p>\n<p>\u6709\u7cbe\u529b\u7684\u670b\u53cb\u5efa\u8bae\u7ffb\u9605\u3002<\/p>\n<p>&#8212;<\/p>\n<p>\u6211\u5728\u77e5\u4e4e\u5f00\u4e86\u4e00\u4e2alive\uff0c4\u670822\u65e5\u665a\uff08\u5468\u516d\uff098\u70b9\u534a\u6211\u5728\u77e5\u4e4e\u4e0e\u5927\u5bb6\u89c1\u9762\uff1a\u30100\u57fa\u7840\u5468\u672b\u5b66\u4e60\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u3011\uff08https:\/\/www.zhihu.com\/lives\/832919740296101888\uff09\uff0c\u6b22\u8fce\u6367\u573a\u3002<\/p>\n<p>\u957f\u6309\u5c0f\u7a0b\u5e8f\u7801\uff0c\u6253\u5f00\u201c\u4fee\u884c\u516c\u793e\u201d\uff0c\u5373\u523b\u52a0\u5165\u201c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u201d\u7c73\u5708<\/p>\n<p>\u672c\u7bc7\u9996\u53d1\u4e8e\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\u54f2\u5b66\u674e\u8bba\uff0c\u4e3b\u63a8\u827a\u672f\/\u6280\u672f\u76f8\u5173\u5185\u5bb9\uff0c\u5173\u6ce8\u7684\u90fd\u662f\u670b\u53cb\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6559\u4f60\u5982\u4f55\u4ece\u96f6\u5efa\u9020\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u9879\u76ee\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>ide\u51c6\u5907 \u4e0b\u8f7d\u5730\u5740\uff1amp.weixin.qq.com\/debug\/wxadoc\/dev\/devtools\/download.html \u77e5\u8bc6\u51c6\u5907 JavaScrip\u8fd8\u662f\u8981\u770b\u770b\u7684\uff0c\u63a8\u8350\u6559\u7a0b\uff1aJavaScript \u521d\u7ea7\u6559\u7a0b \u4ece\u96f6\u5f00\u59cb \u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u5c31\u56db\u79cd\u7c7b\u578b\u7684\u6587\u4ef6 js &#8212;&#8212;&#8212;- JavaScrip\u6587\u4ef6 json &#8212;&#8212;&#8211; \u9879\u76ee\u914d\u7f6e\u6587\u4ef6\uff0c\u8d1f\u8d23\u7a97\u53e3\u989c\u8272\u7b49\u7b49 wxml &#8212;&#8212;- \u7c7b\u4f3cHTML\u6587\u4ef6 wxss &#8212;&#8212;- \u7c7b\u4f3cCSS\u6587\u4ef6 \u5728\u6839\u76ee\u5f55\u4e0b\u7528app\u6765\u547d\u540d\u7684\u8fd9\u56db\u4e2d\u7c7b\u578b\u7684\u6587\u4ef6\uff0c\u5c31\u662f\u7a0b\u5e8f\u5165\u53e3\u6587\u4ef6\u3002 app.json \u5fc5\u987b\u8981\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0cIDE\u4f1a\u62a5\u9519\uff0c\u56e0\u4e3a\u5fae\u4fe1\u6846\u67b6\u628a\u8fd9\u4e2a\u4f5c\u4e3a\u914d\u7f6e\u6587\u4ef6\u5165\u53e3\uff0c \u4f60\u53ea\u9700\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\uff0c\u91cc\u9762\u5199\u4e2a\u5927\u62ec\u53f7\u5c31\u884c \u4ee5\u540e\u6211\u4eec\u4f1a\u5728\u8fd9\u91cc\u5bf9\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\u3002\u8bb0\u5f55\u4e86\u9875\u9762\u7ec4\u6210\uff0c\u914d\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u7a97\u53e3 \u80cc\u666f\u8272\uff0c\u914d\u7f6e\u5bfc\u822a\u6761\u6837\u5f0f\uff0c\u914d\u7f6e\u9ed8\u8ba4\u6807\u9898\u3002 app.js \u5fc5\u987b\u8981\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6ca1\u6709\u4e5f\u662f\u4f1a\u62a5\u9519\uff01\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u521b\u5efa\u4e00\u4e0b\u5c31\u884c \u4ec0\u4e48\u90fd\u4e0d\u9700\u8981\u5199 \u4ee5\u540e\u6211\u4eec\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u76d1\u542c\u5e76\u5904\u7406\u5c0f\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u51fd\u6570\u3001\u58f0\u660e\u5168\u5c40\u53d8\u91cf\u3002 app.wxss \u8fd9\u4e2a\u6587\u4ef6\u4e0d\u662f\u5fc5\u987b\u7684\u3002\u56e0\u4e3a\u5b83\u53ea\u662f\u4e2a\u5168\u5c40CSS\u6837\u5f0f\u6587\u4ef6 app.wxml \u8fd9\u4e2a\u4e5f\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u800c\u4e14\u8fd9\u4e2a\u5e76\u4e0d\u662f\u6307\u4e3b\u754c\u9762\u54e6~\u56e0\u4e3a\u5c0f\u7a0b\u5e8f\u7684\u4e3b\u9875\u9762\u662f\u9760\u5728JSON\u6587\u4ef6\u4e2d\u914d\u7f6e\u6765\u51b3\u5b9a\u7684 \u6709\u4e86\u8fd9\u4e24\u4e2a\u6587\u4ef6\u4f60\u8fd0\u884c\u7a0b\u5e8f\uff0cIDE\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\uff0c\u4e5f\u610f\u5473\u7740\u8fd9\u662f\u6700\u7b80\u5355\u7684\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u521b\u5efa\u7a0b\u5e8f\u5b9e\u4f8bHello World app.js\u6587\u4ef6\u7ba1\u7406\u6574\u4e2a\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\uff0c\u6240\u4ee5\u5728\u91cc\u9762\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a\uff08\u8f93\u5165App IDE\u4f1a\u6709\u63d0\u793a\uff09 App({&nbsp; onLaunch: function () {&nbsp; &nbsp; console.log(&#8216;App Launch&#8217;)&nbsp; },&nbsp; onShow: function () {&nbsp; &nbsp; console.log(&#8216;App Show&#8217;)&nbsp; },&nbsp; [&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-29819","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29819","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=29819"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29819\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=29819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=29819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=29819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}