{"id":185826,"date":"2023-07-23T15:27:44","date_gmt":"2023-07-23T07:27:44","guid":{"rendered":"http:\/\/www.idc.net\/help\/185826\/"},"modified":"2023-07-23T15:27:44","modified_gmt":"2023-07-23T07:27:44","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%95%99%e7%a8%8b%ef%bc%9a%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f-%e6%a1%86%e6%9e%b6%ef%bc%88mina%ef%bc%89","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/185826\/","title":{"rendered":"\u540e\u6d6a\u4e91\u5c0f\u7a0b\u5e8f\u6559\u7a0b\uff1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u6846\u67b6\uff08MINA\uff09"},"content":{"rendered":"<h2>\u6846\u67b6 <\/p>\n<hr>\n<\/h2>\n<p><span style=\"line-height: 1.7\">\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\u7684\u76ee\u6807\u662f\u901a\u8fc7\u5c3d\u53ef\u80fd\u7b80\u5355\u3001\u9ad8\u6548\u7684\u65b9\u5f0f\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5fae\u4fe1\u4e2d\u5f00\u53d1\u5177\u6709\u539f\u751fAPP\u4f53\u9a8c\u7684\u670d\u52a1\u3002<\/span>  <\/p>\n<p>\u6846\u67b6\u63d0\u4f9b\u4e86\u81ea\u5df1\u7684\u89c6\u56fe\u5c42\u63cf\u8ff0\u8bed\u8a00WXML\u548cWXSS\uff0c\u4ee5\u53ca\u57fa\u4e8eJavaScript\u7684\u903b\u8f91\u5c42\u6846\u67b6\uff0c\u5e76\u5728\u89c6\u56fe\u5c42\u4e0e\u903b\u8f91\u5c42\u95f4\u63d0\u4f9b\u4e86\u6570\u636e\u4f20\u8f93\u548c\u4e8b\u4ef6\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u65b9\u4fbf\u7684\u805a\u7126\u4e8e\u6570\u636e\u4e0e\u903b\u8f91\u4e0a\u3002<\/p>\n<p> <\/p>\n<h2>\u54cd\u5e94\u7684\u6570\u636e\u7ed1\u5b9a <\/p>\n<hr>\n<\/h2>\n<p>\u6846\u67b6\u7684\u6838\u5fc3\u662f\u4e00\u4e2a\u54cd\u5e94\u7684\u6570\u636e\u7ed1\u5b9a\u7cfb\u7edf\u3002<\/p>\n<p>\u6574\u4e2a\u7cfb\u7edf\u5206\u4e3a\u4e24\u5757\u89c6\u56fe\u5c42(View)\u548c\u903b\u8f91\u5c42(App Service) <\/p>\n<p>\u6846\u67b6\u53ef\u4ee5\u8ba9\u6570\u636e\u4e0e\u89c6\u56fe<span>\u975e\u5e38\u7b80\u5355\u5730<\/span>\u4fdd\u6301\u540c\u6b65\u3002\u5f53\u505a\u6570\u636e\u4fee\u6539\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u5728\u903b\u8f91\u5c42\u4fee\u6539\u6570\u636e\uff0c\u89c6\u56fe\u5c42\u5c31\u4f1a\u505a\u76f8\u5e94\u7684\u66f4\u65b0\u3002<\/p>\n<p>\u901a\u8fc7\u8fd9\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6765\u770b\uff1a<\/p>\n<pre><code>&lt;!-- Thie is our View --&gt;\n&lt;view&gt; Hello {{name}}! &lt;\/view&gt;\n&lt;button bindtap=\"changeName\"&gt; Click me! &lt;\/button&gt;<\/code><\/pre>\n<pre><code>\/\/ This is our App Service.\n\/\/ This is our data.\nvar helloData = {\n  name: 'WeChat'\n}\n\n\/\/ Register a Page.\nPage({\n  data: helloData,\n  changeName: function(e) {\n    \/\/ sent data change to view.\n    this.setData({\n      name: 'MINA'\n    })\n  }\n})<\/code><\/pre>\n<ul>\n<li>\u5f00\u53d1\u8005\u901a\u8fc7\u6846\u67b6\u5c06\u903b\u8f91\u5c42\u6570\u636e\u4e2d\u7684<code>name<\/code>\u4e0e\u89c6\u56fe\u5c42\u7684<code>name<\/code>\u8fdb\u884c\u4e86\u7ed1\u5b9a\uff0c\u6240\u4ee5\u5728\u9875\u9762\u4e00\u6253\u5f00\u7684\u65f6\u5019\u4f1a\u663e\u793a<code>Hello WeChat!<\/code> <\/li>\n<li>\u5f53\u70b9\u51fb\u6309\u94ae\u7684\u65f6\u5019\uff0c\u89c6\u56fe\u5c42\u4f1a\u53d1\u9001<code>changeName<\/code>\u7684\u4e8b\u4ef6\u7ed9\u903b\u8f91\u5c42\uff0c\u903b\u8f91\u5c42\u627e\u5230\u5bf9\u5e94\u7684\u4e8b\u4ef6\u5904\u7406\u51fd\u6570<\/li>\n<li>\u903b\u8f91\u5c42\u6267\u884c\u4e86<code>setData<\/code>\u7684\u64cd\u4f5c\uff0c\u5c06name\u4ece<code>weChat<\/code>\u53d8\u4e3a<code>MINA<\/code>\uff0c\u56e0\u4e3a\u8be5\u6570\u636e\u548c\u89c6\u56fe\u5c42\u5df2\u7ecf\u7ed1\u5b9a\u4e86\uff0c\u4ece\u800c\u89c6\u56fe\u5c42\u4f1a\u81ea\u52a8\u54cd\u5e94\u6539\u53d8\u4e3a<code>Hello MINA!<\/code> \u3002<\/li>\n<\/ul>\n<h2>\u9875\u9762\u7ba1\u7406 <\/p>\n<hr>\n<\/h2>\n<p>\u6846\u67b6\u7ba1\u7406\u4e86\u6574\u4e2a<strong>\u5c0f\u7a0b\u5e8f<\/strong>\u7684\u9875\u9762\u8def\u7531\uff0c\u53ef\u4ee5\u505a\u5230\u9875\u9762\u95f4\u7684\u65e0\u7f1d\u5207\u6362\uff0c\u5e76\u7ed9\u4ee5\u9875\u9762\u5b8c\u6574\u7684\u751f\u547d\u5468\u671f\u3002\u5f00\u53d1\u8005\u9700\u8981\u505a\u7684\u53ea\u662f\u5c06\u9875\u9762\u7684\u6570\u636e\uff0c\u65b9\u6cd5\uff0c\u751f\u547d\u5468\u671f\u51fd\u6570\u6ce8\u518c\u8fdb\u6846\u67b6\u4e2d\uff0c\u5176\u4ed6\u7684\u4e00\u5207\u590d\u6742\u7684\u64cd\u4f5c\u90fd\u4ea4\u7531\u6846\u67b6\u5904\u7406\u3002<\/p>\n<h2>\u57fa\u7840\u7ec4\u4ef6 <\/p>\n<hr>\n<\/h2>\n<p>\u6846\u67b6\u63d0\u4f9b\u4e86\u4e00\u5957\u57fa\u7840\u7684\u7ec4\u4ef6\uff0c\u8fd9\u4e9b\u7ec4\u4ef6\u81ea\u5e26\u5fae\u4fe1\u98ce\u683c\u7684\u6837\u5f0f\u4ee5\u53ca\u7279\u6b8a\u7684\u903b\u8f91\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u7ec4\u5408\u57fa\u7840\u7ec4\u4ef6\uff0c\u521b\u5efa\u51fa\u5f3a\u5927\u7684<strong>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f<\/strong> \u3002<\/p>\n<h2>\u4e30\u5bcc\u7684API <\/p>\n<hr>\n<\/h2>\n<p>\u6846\u67b6\u63d0\u4f9b\u4e30\u5bcc\u7684<code>\u5fae\u4fe1\u539f\u751fAPI<\/code>\uff0c\u53ef\u4ee5\u65b9\u4fbf\u7684\u8c03\u8d77\u5fae\u4fe1\u63d0\u4f9b\u7684\u80fd\u529b\uff0c\u5982\u83b7\u53d6\u7528\u6237\u4fe1\u606f\uff0c\u672c\u5730\u5b58\u50a8\uff0c\u652f\u4ed8\u529f\u80fd\u7b49\u3002<\/p>\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6846\u67b6 \u5c0f\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\u7684\u76ee\u6807\u662f\u901a\u8fc7\u5c3d\u53ef\u80fd\u7b80\u5355\u3001\u9ad8\u6548\u7684\u65b9\u5f0f\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5fae\u4fe1\u4e2d\u5f00\u53d1\u5177\u6709\u539f\u751fAPP\u4f53\u9a8c\u7684\u670d\u52a1\u3002 \u6846\u67b6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-185826","post","type-post","status-publish","format-standard","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/185826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=185826"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/185826\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=185826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=185826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=185826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}