{"id":1319,"date":"2023-03-18T11:29:16","date_gmt":"2023-03-18T03:29:16","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1319"},"modified":"2023-04-29T09:11:52","modified_gmt":"2023-04-29T01:11:52","slug":"taro-basic-tutorial-vue","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/18\/taro-basic-tutorial-vue\/","title":{"rendered":"Taro\u57fa\u7840\u6559\u7a0b\u4e4bVue"},"content":{"rendered":"<p>\u5728<code>Taro<\/code>\u53ef\u4ee5\u901a\u8fc7<code>import Vue from &#039;vue&#039;<\/code>\u6765\u4f7f\u7528<code>Vue<\/code>\uff0c\u4f46\u548c\u5728\u6d4f\u89c8\u5668\u4e2d\u4f7f\u7528<code>Vue<\/code>\u4f9d\u7136\u6709\u4e00\u4e9b\u4e0d\u540c<\/p>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/taro-docs.jd.com\/taro\/docs\/vue\">https:\/\/taro-docs.jd.com\/taro\/docs\/vue<\/a><\/p>\n<h2>\u5165\u53e3\u7ec4\u4ef6<\/h2>\n<p><!-- more --><\/p>\n<p>\u6bcf\u4e00\u4e2a<code>Taro<\/code>\u5e94\u7528\u90fd\u9700\u8981\u4e00\u4e2a\u5165\u53e3\u7ec4\u4ef6\u7528\u6765\u6ce8\u518c\u5e94\u7528\uff0c\u5165\u53e3\u6587\u4ef6\u9ed8\u8ba4\u662f<code>src<\/code>\u76ee\u5f55\u4e0b\u7684<code>app.js<\/code>\u3002\u5728<code>Taro<\/code>\u4e2d\u4f7f\u7528<code>Vue<\/code>\uff0c\u5165\u53e3\u7ec4\u4ef6\u5fc5\u987b\u5bfc\u51fa\u4e00\u4e2a<code>Vue<\/code>\u7ec4\u4ef6\uff0c\u5728\u5165\u53e3\u7ec4\u4ef6\u4e2d\u6211\u4eec\u53ef\u4ee5\u8bbe\u7f6e\u5168\u5c40\u72b6\u6001\u6216\u8bbf\u95ee\u5c0f\u7a0b\u5e8f\u5165\u53e3\u5b9e\u4f8b\u7684\u751f\u547d\u5468\u671f\uff1a<\/p>\n<pre><code class=\"language-javascript\">import Vue from &#039;vue&#039;\n\/\/ \u5047\u8bbe\u6211\u4eec\u5df2\u7ecf\u5728 &#039;.\/store&#039; \u914d\u7f6e\u597d\u4e86 vuex\nimport store from &#039;.\/store&#039;\n\nconst App = new Vue({\n  store,\n  onShow (options) {\n  },\n  render(h) {\n    \/\/ this.$slots.default \u662f\u5c06\u8981\u4f1a\u6e32\u67d3\u7684\u9875\u9762\n    return h(&#039;block&#039;, this.$slots.default)\n  }\n})\n\nexport default App<\/code><\/pre>\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u5165\u53e3\u6587\u4ef6(\u4f8b\u5982<code>app.js<\/code>)\u800c\u8a00\uff0c\u6211\u4eec\u53ef\u4ee5\u65b0\u589e\u4e00\u4e2a<code>app.config.js<\/code>\u7684\u6587\u4ef6\u8fdb\u884c\u5168\u5c40\u914d\u7f6e\uff0c<code>app.config.js<\/code>\u7684\u9ed8\u8ba4\u5bfc\u51fa\u5c31\u662f\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e:<\/p>\n<pre><code class=\"language-javascript\">\/\/ app.config.js\nexport default {\n  pages: [\n    &#039;pages\/index\/index&#039;\n  ],\n  window: {\n    backgroundTextStyle: &#039;light&#039;,\n    navigationBarBackgroundColor: &#039;#fff&#039;,\n    navigationBarTitleText: &#039;WeChat&#039;,\n    navigationBarTextStyle: &#039;black&#039;\n  }\n}<\/code><\/pre>\n<h3>\u751f\u547d\u5468\u671f<\/h3>\n<h4>onLaunch()<\/h4>\n<p>\u5728\u5fae\u4fe1\/\u767e\u5ea6\/\u5b57\u8282\u8df3\u52a8\/\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e2d\u8fd9\u4e00\u751f\u547d\u5468\u671f\u65b9\u6cd5\u5bf9\u5e94 app \u7684<code>onLaunch<\/code><\/p>\n<p>\u76d1\u542c\u7a0b\u5e8f\u521d\u59cb\u5316\uff0c\u521d\u59cb\u5316\u5b8c\u6210\u65f6\u89e6\u53d1\uff08\u5168\u5c40\u53ea\u89e6\u53d1\u4e00\u6b21\uff09<\/p>\n<p>\u5728\u6b64\u751f\u547d\u5468\u671f\u4e2d\u901a\u8fc7<code>getCurrentInstance().router.params<\/code>\uff0c\u53ef\u4ee5\u8bbf\u95ee\u5230\u7a0b\u5e8f\u521d\u59cb\u5316\u53c2\u6570<\/p>\n<h4>created()<\/h4>\n<p>\u5728\u5fae\u4fe1\/\u767e\u5ea6\/\u5b57\u8282\u8df3\u52a8\/\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e2d\u8fd9\u4e00\u751f\u547d\u5468\u671f\u65b9\u6cd5\u5bf9\u5e94 app \u7684<code>onLaunch<\/code>\uff0c\u5728<code>componentWillMount<\/code>\u540e\u6267\u884c<\/p>\n<p>\u76d1\u542c\u7a0b\u5e8f\u521d\u59cb\u5316\uff0c\u521d\u59cb\u5316\u5b8c\u6210\u65f6\u89e6\u53d1\uff08\u5168\u5c40\u53ea\u89e6\u53d1\u4e00\u6b21\uff09<\/p>\n<h4>onShow()<\/h4>\n<p>\u5728\u5fae\u4fe1\/\u767e\u5ea6\/\u5b57\u8282\u8df3\u52a8\/\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e2d\u8fd9\u4e00\u751f\u547d\u5468\u671f\u65b9\u6cd5\u5bf9\u5e94<code>onShow<\/code>\uff0c\u5728 H5\/RN \u4e2d\u540c\u6b65\u5b9e\u73b0<\/p>\n<p>\u7a0b\u5e8f\u542f\u52a8\uff0c\u6216\u4ece\u540e\u53f0\u8fdb\u5165\u524d\u53f0\u663e\u793a\u65f6\u89e6\u53d1\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>Taro.onAppShow<\/code>\u7ed1\u5b9a\u76d1\u542c<\/p>\n<p>\u5728\u6b64\u751f\u547d\u5468\u671f\u4e2d\u901a\u8fc7<code>this.$router.params<\/code>\uff0c\u53ef\u4ee5\u8bbf\u95ee\u5230\u7a0b\u5e8f\u521d\u59cb\u5316\u53c2\u6570<\/p>\n<p>\u53c2\u6570\u4e0e<code>componentWillMount<\/code>\u4e2d\u83b7\u53d6\u7684\u57fa\u672c\u4e00\u81f4\uff0c\u4f46\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u4e2d\u8865\u5145<code>entryType<\/code>\u548c<code>appURL<\/code>\u4e24\u4e2a\u53c2\u6570<\/p>\n<h4>onHide()<\/h4>\n<p>\u5728\u5fae\u4fe1\/\u767e\u5ea6\/\u5b57\u8282\u8df3\u52a8\/\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e2d\u8fd9\u4e00\u751f\u547d\u5468\u671f\u65b9\u6cd5\u5bf9\u5e94<code>onHide<\/code>\uff0c\u5728 H5\/RN \u4e2d\u540c\u6b65\u5b9e\u73b0<\/p>\n<p>\u7a0b\u5e8f\u4ece\u524d\u53f0\u8fdb\u5165\u540e\u53f0\u65f6\u89e6\u53d1\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>Taro.onAppHide<\/code>\u7ed1\u5b9a\u76d1\u542c<\/p>\n<h4>onError(String error)<\/h4>\n<p>\u5728\u5fae\u4fe1\/\u767e\u5ea6\/\u5b57\u8282\u8df3\u52a8\/\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u4e2d\u8fd9\u4e00\u751f\u547d\u5468\u671f\u65b9\u6cd5\u5bf9\u5e94<code>onError<\/code>\uff0cH5\/RN \u4e2d\u5c1a\u672a\u5b9e\u73b0<\/p>\n<p>\u7a0b\u5e8f\u53d1\u751f\u811a\u672c\u9519\u8bef\u6216 API \u8c03\u7528\u62a5\u9519\u65f6\u89e6\u53d1\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>Taro.onError<\/code>\u7ed1\u5b9a\u76d1\u542c<\/p>\n<h4>onPageNotFound(Object)<\/h4>\n<p>\u5728\u5fae\u4fe1\/\u5b57\u8282\u8df3\u52a8\u5c0f\u7a0b\u5e8f\u4e2d\u8fd9\u4e00\u751f\u547d\u5468\u671f\u65b9\u6cd5\u5bf9\u5e94<code>onPageNotFound<\/code>\uff0c\u5176\u4ed6\u7aef\u5c1a\u672a\u5b9e\u73b0<br \/>\n\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\uff0c\u57fa\u7840\u5e93 1.9.90 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u7a0b\u5e8f\u8981\u6253\u5f00\u7684\u9875\u9762\u4e0d\u5b58\u5728\u65f6\u89e6\u53d1\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>Taro.onPageNotFound<\/code>\u7ed1\u5b9a\u76d1\u542c<\/p>\n<h2>\u9875\u9762\u7ec4\u4ef6<\/h2>\n<p>\u6bcf\u4e00\u4e2a<code>Taro<\/code>\u5e94\u7528\u90fd\u81f3\u5c11\u5305\u62ec\u4e00\u4e2a\u9875\u9762\u7ec4\u4ef6\uff0c\u9875\u9762\u7ec4\u4ef6\u53ef\u4ee5\u901a\u8fc7<code>Taro<\/code>\u8def\u7531\u8fdb\u884c\u8df3\u8f6c\uff0c\u4e5f\u53ef\u4ee5\u8bbf\u95ee\u5c0f\u7a0b\u5e8f\u9875\u9762\u7684\u751f\u547d\u5468\u671f\uff0c\u6bcf\u4e00\u4e2a\u9875\u9762\u7ec4\u4ef6\u5fc5\u987b\u662f\u4e00\u4e2a<code>.vue<\/code>\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-html\">&lt;template&gt;\n  &lt;view class=&quot;index&quot;&gt;\n    &lt;NumberDisplay \/&gt;\n    &lt;NumberSubmit \/&gt;\n  &lt;\/view&gt;\n&lt;\/template&gt;\n\n&lt;script&gt;\nimport NumberDisplay from &#039;..\/..\/components\/NumberDisplay.vue&#039;\nimport NumberSubmit from &#039;..\/..\/components\/NumberSubmit.vue&#039;\n\nexport default {\n  name: &#039;Index&#039;,\n  components: {\n    NumberDisplay,\n    NumberSubmit\n  }\n}\n&lt;\/script&gt;\n\n&lt;style&gt;\n.index {\n  font-family: &quot;Avenir&quot;, Helvetica, Arial, sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  text-align: center;\n  color: #2c3e50;\n  margin-top: 60px;\n}\n&lt;\/style&gt;<\/code><\/pre>\n<h3>\u9875\u9762\u914d\u7f6e<\/h3>\n<p>\u548c\u5165\u53e3\u7ec4\u4ef6\u4e00\u6837\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u9875\u9762\u6587\u4ef6(\u4f8b\u5982<code>.\/pages\/index\/index.vue<\/code>)\u800c\u8a00\uff0c\u6211\u4eec\u53ef\u4ee5\u65b0\u589e\u4e00\u4e2a<code>.\/pages\/index\/index.config.js<\/code>\u7684\u6587\u4ef6\u8fdb\u884c\u9875\u9762\u914d\u7f6e\uff0c<code>index.config.js<\/code>\u7684\u9ed8\u8ba4\u5bfc\u51fa\u5c31\u662f\u7684\u9875\u9762\u914d\u7f6e\uff0c\u6bcf\u4e00\u4e2a\u9875\u9762\u90fd\u62e5\u6709\u81ea\u5df1\u914d\u7f6e<code>config<\/code>\uff0c\u8fd9\u4e2a\u914d\u7f6e\u662f\u9488\u5bf9\u5f53\u524d\u9875\u9762\u914d\u7f6e\uff0c\u914d\u7f6e\u89c4\u8303\u57fa\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u9875\u9762\u914d\u7f6e\u8fdb\u884c\u5236\u5b9a\uff0c\u6240\u6709\u5e73\u53f0\u8fdb\u884c\u7edf\u4e00<\/p>\n<h3>\u751f\u547d\u5468\u671f<\/h3>\n<h4>onReady()<\/h4>\n<p>\u9875\u9762\u9996\u6b21\u6e32\u67d3\u5b8c\u6bd5\u65f6\u6267\u884c\uff0c\u6b64\u751f\u547d\u5468\u671f\u5728\u5c0f\u7a0b\u5e8f\u7aef\u5bf9\u5e94\u5c0f\u7a0b\u5e8f\u9875\u9762\u7684<code>onReady<\/code>\u751f\u547d\u5468\u671f\u3002\u4ece\u6b64\u751f\u547d\u5468\u671f\u5f00\u59cb\u53ef\u4ee5\u4f7f\u7528<code>createCanvasContext<\/code>\u6216<code>createselectorquery<\/code>\u7b49 API \u8bbf\u95ee\u771f\u5b9e DOM\u3002<\/p>\n<p>\u5728\u53ef\u4ee5\u975e\u9875\u9762\u7ec4\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>Taro<\/code>\u5185\u7f6e\u7684 <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/taro-docs.jd.com\/taro\/docs\/react\/apis\/about\/events\" title=\"\u6d88\u606f\u673a\u5236\">\u6d88\u606f\u673a\u5236<\/a> \u8bbf\u95ee\u9875\u9762\u7ec4\u4ef6\u7684<code>onReady()<\/code>\u751f\u547d\u5468\u671f\uff1a<\/p>\n<pre><code class=\"language-javascript\">&lt;template&gt;\n  &lt;view id=&quot;only&quot; \/&gt;\n&lt;\/template&gt;\n&lt;script&gt;\n  import { eventCenter, getCurrentInstance } from &#039;@tarojs\/taro&#039;\n\n  export default {\n    mounted () {\n      eventCenter.once(getCurrentInstance().router.onReady, () =&gt; {\n        const query = Taro.createSelectorQuery()\n        query.select(&#039;#only&#039;).boundingClientRect()\n        query.exec(res =&gt; {\n          console.log(res, &#039;res&#039;)\n        })\n        console.log(&#039;onReady&#039;)\n      })\n    }\n  }\n&lt;\/script&gt;<\/code><\/pre>\n<h4>onLoad(options)<\/h4>\n<p>\u9875\u9762\u521b\u5efa\u65f6\u6267\u884c\uff0c\u6b64\u751f\u547d\u5468\u671f\u5728\u5c0f\u7a0b\u5e8f\u7aef\u5bf9\u5e94\u5c0f\u7a0b\u5e8f\u9875\u9762\u7684<code>onLoad<\/code>\u751f\u547d\u5468\u671f\u3002\u6b64\u751f\u547d\u5468\u671f\u53ef\u4ee5\u8bbf\u95ee<code>getCurrentInstance().router<\/code>\u3002<\/p>\n<h4>created()<\/h4>\n<p>\u9875\u9762\u52a0\u8f7d\u65f6\u89e6\u53d1\uff0c\u4e00\u4e2a\u9875\u9762\u53ea\u4f1a\u8c03\u7528\u4e00\u6b21\uff0c\u6b64\u65f6\u9875\u9762 DOM \u5c1a\u672a\u51c6\u5907\u597d\uff0c\u8fd8\u4e0d\u80fd\u548c\u89c6\u56fe\u5c42\u8fdb\u884c\u4ea4\u4e92<\/p>\n<h4>mounted()<\/h4>\n<p>\u9875\u9762\u521d\u6b21\u6e32\u67d3\u5b8c\u6210\u65f6\u89e6\u53d1\uff0c\u4e00\u4e2a\u9875\u9762\u53ea\u4f1a\u8c03\u7528\u4e00\u6b21\uff0c\u4ee3\u8868\u9875\u9762\u5df2\u7ecf\u51c6\u5907\u59a5\u5f53\uff0c\u53ef\u4ee5\u548c\u89c6\u56fe\u5c42\u8fdb\u884c\u4ea4\u4e92<\/p>\n<h4>beforeUpdate()<\/h4>\n<p>\u9875\u9762\u5373\u5c06\u66f4\u65b0<\/p>\n<h4>updated(prevProps, prevState)<\/h4>\n<p>\u9875\u9762\u66f4\u65b0\u5b8c\u6bd5<\/p>\n<h4>beforeDestroy()<\/h4>\n<p>\u9875\u9762\u5378\u8f7d\u65f6\u89e6\u53d1\uff0c\u5982<code>redirectTo<\/code>\u6216<code>navigateBack<\/code>\u5230\u5176\u4ed6\u9875\u9762\u65f6<\/p>\n<h4>onShow()<\/h4>\n<p>\u9875\u9762\u663e\u793a\/\u5207\u5165\u524d\u53f0\u65f6\u89e6\u53d1<\/p>\n<h4>onHide()<\/h4>\n<p>\u9875\u9762\u9690\u85cf\/\u5207\u5165\u540e\u53f0\u65f6\u89e6\u53d1\uff0c \u5982<code>navigateTo<\/code>\u6216\u5e95\u90e8<code>tab<\/code>\u5207\u6362\u5230\u5176\u4ed6\u9875\u9762\uff0c\u5c0f\u7a0b\u5e8f\u5207\u5165\u540e\u53f0\u7b49<\/p>\n<p>\u5728\u4ee5\u4e0a\u6240\u6709\u7684\u751f\u547d\u5468\u671f\u65b9\u6cd5\u4e2d\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7<code>getCurrentInstance().router<\/code>\u83b7\u53d6\u6253\u5f00\u5f53\u524d\u9875\u9762\u8def\u5f84\u4e2d\u7684\u53c2\u6570\u3002<\/p>\n<h3>\u9875\u9762\u4e8b\u4ef6\u5904\u7406\u51fd\u6570<\/h3>\n<p>\u5728\u5c0f\u7a0b\u5e8f\u4e2d\uff0c\u9875\u9762\u8fd8\u6709\u5728\u4e00\u4e9b\u4e13\u5c5e\u7684\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\uff0c\u5982\u4e0b<\/p>\n<h4>onPullDownRefresh()<\/h4>\n<p>\u76d1\u542c\u7528\u6237\u4e0b\u62c9\u5237\u65b0\u4e8b\u4ef6<\/p>\n<ul>\n<li>\u9700\u8981\u5728\u5168\u5c40\u914d\u7f6e\u7684<code>window<\/code>\u9009\u9879\u4e2d\u6216\u9875\u9762\u914d\u7f6e\u4e2d\u5f00\u542f<code>enablePullDownRefresh<\/code><\/li>\n<li>\u53ef\u4ee5\u901a\u8fc7<code>Taro.startPullDownRefresh<\/code>\u89e6\u53d1\u4e0b\u62c9\u5237\u65b0\uff0c\u8c03\u7528\u540e\u89e6\u53d1\u4e0b\u62c9\u5237\u65b0\u52a8\u753b\uff0c\u6548\u679c\u4e0e\u7528\u6237\u624b\u52a8\u4e0b\u62c9\u5237\u65b0\u4e00\u81f4<\/li>\n<li>\u5f53\u5904\u7406\u5b8c\u6570\u636e\u5237\u65b0\u540e\uff0c<code>Taro.stopPullDownRefresh<\/code>\u53ef\u4ee5\u505c\u6b62\u5f53\u524d\u9875\u9762\u7684\u4e0b\u62c9\u5237\u65b0<\/li>\n<\/ul>\n<h4>onReachBottom()<\/h4>\n<p>\u76d1\u542c\u7528\u6237\u4e0a\u62c9\u89e6\u5e95\u4e8b\u4ef6<\/p>\n<ul>\n<li>\u53ef\u4ee5\u5728\u5168\u5c40\u914d\u7f6e\u7684<code>window<\/code>\u9009\u9879\u4e2d\u6216\u9875\u9762\u914d\u7f6e\u4e2d\u8bbe\u7f6e\u89e6\u53d1\u8ddd\u79bb<code>onReachBottomDistance<\/code><\/li>\n<li>\u5728\u89e6\u53d1\u8ddd\u79bb\u5185\u6ed1\u52a8\u671f\u95f4\uff0c\u672c\u4e8b\u4ef6\u53ea\u4f1a\u88ab\u89e6\u53d1\u4e00\u6b21<\/li>\n<\/ul>\n<h4>onPageScroll(Object)<\/h4>\n<p>\u76d1\u542c\u7528\u6237\u6ed1\u52a8\u9875\u9762\u4e8b\u4ef6<\/p>\n<p>Object \u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>scrollTop<\/code><\/td>\n<td style=\"text-align: left;\">Number<\/td>\n<td style=\"text-align: left;\">\u9875\u9762\u5728\u5782\u76f4\u65b9\u5411\u5df2\u6eda\u52a8\u7684\u8ddd\u79bb\uff08\u5355\u4f4dpx\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\u6ce8\u610f\uff1a\u8bf7\u53ea\u5728\u9700\u8981\u7684\u65f6\u5019\u624d\u5728<code>page<\/code>\u4e2d\u5b9a\u4e49\u6b64\u65b9\u6cd5\uff0c\u4e0d\u8981\u5b9a\u4e49\u7a7a\u65b9\u6cd5\u3002\u4ee5\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u4e8b\u4ef6\u6d3e\u53d1\u5bf9\u6e32\u67d3\u5c42-\u903b\u8f91\u5c42\u901a\u4fe1\u7684\u5f71\u54cd<br \/>\n\u6ce8\u610f\uff1a\u8bf7\u907f\u514d\u5728<code>onPageScroll<\/code>\u4e2d\u8fc7\u4e8e\u9891\u7e41\u7684\u6267\u884c<code>this.setState()<\/code>\u7b49\u5f15\u8d77\u903b\u8f91\u5c42-\u6e32\u67d3\u5c42\u901a\u4fe1\u7684\u64cd\u4f5c\u3002\u5c24\u5176\u662f\u6bcf\u6b21\u4f20\u8f93\u5927\u91cf\u6570\u636e\uff0c\u4f1a\u5f71\u54cd\u901a\u4fe1\u8017\u65f6<\/p>\n<\/blockquote>\n<h4>onShareAppMessage(Object)<\/h4>\n<p>\u76d1\u542c\u7528\u6237\u70b9\u51fb\u9875\u9762\u5185\u8f6c\u53d1\u6309\u94ae\uff08Button \u7ec4\u4ef6<code>openType=&#039;share&#039;<\/code>\uff09\u6216\u53f3\u4e0a\u89d2\u83dc\u5355\u201c\u8f6c\u53d1\u201d\u6309\u94ae\u7684\u884c\u4e3a\uff0c\u5e76\u81ea\u5b9a\u4e49\u8f6c\u53d1\u5185\u5bb9\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u53ea\u6709\u5b9a\u4e49\u4e86\u6b64\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\uff0c\u53f3\u4e0a\u89d2\u83dc\u5355\u624d\u4f1a\u663e\u793a\u201c\u8f6c\u53d1\u201d\u6309\u94ae<\/p>\n<p>Object \u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>from<\/code><\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">\u8f6c\u53d1\u4e8b\u4ef6\u6765\u6e90<br \/>button\uff1a\u9875\u9762\u5185\u8f6c\u53d1\u6309\u94ae<br \/>menu\uff1a\u53f3\u4e0a\u89d2\u8f6c\u53d1\u83dc\u5355<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>target<\/code><\/td>\n<td style=\"text-align: left;\">Object<\/td>\n<td style=\"text-align: left;\">\u5982\u679c<code>from<\/code>\u503c\u662f<code>button<\/code>\uff0c\u5219<code>target<\/code>\u662f\u89e6\u53d1\u8fd9\u6b21\u8f6c\u53d1\u4e8b\u4ef6\u7684<code>button<\/code>\uff0c<br \/>\u5426\u5219\u4e3a<code>undefined<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>webViewUrl<\/code><\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">\u9875\u9762\u4e2d\u5305\u542b<code>WebView<\/code>\u7ec4\u4ef6\u65f6\uff0c\u8fd4\u56de\u5f53\u524d WebView \u7684url<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6b64\u4e8b\u4ef6\u9700\u8981<code>return<\/code>\u4e00\u4e2a<code>Object<\/code>\uff0c\u7528\u4e8e\u81ea\u5b9a\u4e49\u8f6c\u53d1\u5185\u5bb9\uff0c\u8fd4\u56de\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>\u81ea\u5b9a\u4e49\u8f6c\u53d1\u5185\u5bb9<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>title<\/code><\/td>\n<td style=\"text-align: left;\">\u8f6c\u53d1\u6807\u9898<\/td>\n<td style=\"text-align: left;\">\u5f53\u524d\u5c0f\u7a0b\u5e8f\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>path<\/code><\/td>\n<td style=\"text-align: left;\">\u8f6c\u53d1\u8def\u5f84<\/td>\n<td style=\"text-align: left;\">\u5f53\u524d\u9875\u9762<code>path<\/code>\uff0c\u5fc5\u987b\u662f\u4ee5<code>\/<\/code>\u5f00\u5934\u7684\u5b8c\u6574\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>imageUrl<\/code><\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49\u56fe\u7247\u8def\u5f84\uff0c\u53ef\u4ee5\u662f\u672c\u5730\u6587\u4ef6\u8def\u5f84\u3001\u4ee3\u7801\u5305\u6587\u4ef6\u8def\u5f84\u6216\u8005\u7f51\u7edc\u56fe\u7247\u8def\u5f84\u3002<br \/>\u652f\u6301 PNG \u53ca JPG \u3002\u663e\u793a\u56fe\u7247\u957f\u5bbd\u6bd4\u662f 5:4<\/td>\n<td style=\"text-align: left;\">\u4f7f\u7528\u9ed8\u8ba4\u622a\u56fe<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b\u4ee3\u7801<\/p>\n<pre><code class=\"language-javascript\">export default class Index extends Component {\n  config = {\n    navigationBarTitleText: &#039;\u9996\u9875&#039;\n  }\n\n  onShareAppMessage (res) {\n    if (res.from === &#039;button&#039;) {\n      \/\/ \u6765\u81ea\u9875\u9762\u5185\u8f6c\u53d1\u6309\u94ae\n      console.log(res.target)\n    }\n    return {\n      title: &#039;\u81ea\u5b9a\u4e49\u8f6c\u53d1\u6807\u9898&#039;,\n      path: &#039;\/page\/user?id=123&#039;\n    }\n  }\n\n  render () {\n    return (\n      &lt;View className=&#039;index&#039;&gt;\n        &lt;Text&gt;1&lt;\/Text&gt;\n      &lt;\/View&gt;\n    )\n  }\n}<\/code><\/pre>\n<h4>onResize(Object)<\/h4>\n<p>\u53ea\u6709\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u57fa\u7840\u5e93 2.4.0 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u5c0f\u7a0b\u5e8f\u5c4f\u5e55\u65cb\u8f6c\u65f6\u89e6\u53d1\u3002\u8be6\u89c1 <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/developers.weixin.qq.com\/miniprogram\/dev\/framework\/view\/resizable.html#%E5%9C%A8%E6%89%8B%E6%9C%BA%E4%B8%8A%E5%90%AF%E7%94%A8%E5%B1%8F%E5%B9%95%E6%97%8B%E8%BD%AC%E6%94%AF%E6%8C%81\" title=\"\u54cd\u5e94\u663e\u793a\u533a\u57df\u53d8\u5316\">\u54cd\u5e94\u663e\u793a\u533a\u57df\u53d8\u5316<\/a><\/p>\n<h4>onTabItemTap(Object)<\/h4>\n<p>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\uff0c\u57fa\u7840\u5e93 1.9.0 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u70b9\u51fb<code>tab<\/code>\u65f6\u89e6\u53d1<\/p>\n<p><code>Object<\/code>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>index<\/code><\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">\u88ab\u70b9\u51fb tabItem \u7684\u5e8f\u53f7\uff0c\u4ece 0 \u5f00\u59cb<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>pagePath<\/code><\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">\u88ab\u70b9\u51fb tabItem \u7684\u9875\u9762\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>text<\/code><\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">\u88ab\u70b9\u51fb tabItem \u7684\u6309\u94ae\u6587\u5b57<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>onAddToFavorites(Object)<\/h4>\n<p>Taro 3.0.3 \u7248\u672c\u5f00\u59cb\u652f\u6301\uff0c\u53ea\u6709\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u672c\u63a5\u53e3\u4e3a Beta \u7248\u672c\uff0c\u5b89\u5353 7.0.15 \u7248\u672c\u8d77\u652f\u6301\uff0c\u6682\u53ea\u5728\u5b89\u5353\u5e73\u53f0\u652f\u6301<\/p>\n<p>\u76d1\u542c\u7528\u6237\u70b9\u51fb\u53f3\u4e0a\u89d2\u83dc\u5355\u201c\u6536\u85cf\u201d\u6309\u94ae\u7684\u884c\u4e3a\uff0c\u5e76\u81ea\u5b9a\u4e49\u6536\u85cf\u5185\u5bb9\u3002<\/p>\n<p><code>Object<\/code>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>webviewUrl<\/code><\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">\u9875\u9762\u4e2d\u5305\u542bweb-view\u7ec4\u4ef6\u65f6\uff0c\u8fd4\u56de\u5f53\u524dweb-view\u7684url<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6b64\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u9700\u8981<code>return<\/code>\u4e00\u4e2a<code>Object<\/code>\uff0c\u7528\u4e8e\u81ea\u5b9a\u4e49\u6536\u85cf\u5185\u5bb9\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u9ed8\u8ba4\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>title<\/code><\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49\u6807\u9898<\/td>\n<td style=\"text-align: left;\">\u9875\u9762\u6807\u9898\u6216\u8d26\u53f7\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>imageUrl<\/code><\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49\u56fe\u7247\uff0c\u663e\u793a\u56fe\u7247\u957f\u5bbd\u6bd4\u4e3a 1\uff1a1<\/td>\n<td style=\"text-align: left;\">\u9875\u9762\u622a\u56fe<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>query<\/code><\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49query\u5b57\u6bb5<\/td>\n<td style=\"text-align: left;\">\u5f53\u524d\u9875\u9762\u7684query<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b\u4ee3\u7801<\/p>\n<pre><code class=\"language-javascript\">onAddToFavorites(res) {\n  \/\/ webview \u9875\u9762\u8fd4\u56de webviewUrl\n  console.log(&#039;WebviewUrl: &#039;, res.webviewUrl)\n  return {\n    title: &#039;\u81ea\u5b9a\u4e49\u6807\u9898&#039;,\n    imageUrl: &#039;http:\/\/demo.png&#039;,\n    query: &#039;name=xxx&amp;age=xxx&#039;,\n  }\n}<\/code><\/pre>\n<h4>onShareTimeline()<\/h4>\n<p>Taro 3.0.3 \u7248\u672c\u5f00\u59cb\u652f\u6301\uff0c\u53ea\u6709\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u57fa\u7840\u5e93 2.11.3 \u5f00\u59cb\u652f\u6301\uff0c\u672c\u63a5\u53e3\u4e3a Beta \u7248\u672c\uff0c\u6682\u53ea\u5728 Android \u5e73\u53f0\u652f\u6301<\/p>\n<p>\u76d1\u542c\u53f3\u4e0a\u89d2\u83dc\u5355\u201c\u5206\u4eab\u5230\u670b\u53cb\u5708\u201d\u6309\u94ae\u7684\u884c\u4e3a\uff0c\u5e76\u81ea\u5b9a\u4e49\u5206\u4eab\u5185\u5bb9\u3002<\/p>\n<blockquote>\n<p>\u6ce8\u610f\uff1a\u53ea\u6709\u5b9a\u4e49\u4e86\u6b64\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\uff0c\u53f3\u4e0a\u89d2\u83dc\u5355\u624d\u4f1a\u663e\u793a\u201c\u5206\u4eab\u5230\u670b\u53cb\u5708\u201d\u6309\u94ae<\/p>\n<\/blockquote>\n<p>\u81ea\u5b9a\u4e49\u8f6c\u53d1\u5185\u5bb9<\/p>\n<p>\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a<code>Object<\/code>\uff0c\u7528\u4e8e\u81ea\u5b9a\u4e49\u5206\u4eab\u5185\u5bb9\uff0c\u4e0d\u652f\u6301\u81ea\u5b9a\u4e49\u9875\u9762\u8def\u5f84\uff0c\u8fd4\u56de\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: left;\">\u9ed8\u8ba4\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">title<\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49\u6807\u9898<\/td>\n<td style=\"text-align: left;\">\u5f53\u524d\u5c0f\u7a0b\u5e8f\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">query<\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49\u9875\u9762\u8def\u5f84\u4e2d\u643a\u5e26\u7684\u53c2\u6570<\/td>\n<td style=\"text-align: left;\">\u5f53\u524d\u9875\u9762\u8def\u5f84\u643a\u5e26\u7684\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">imageUrl<\/td>\n<td style=\"text-align: left;\">\u81ea\u5b9a\u4e49\u56fe\u7247\u8def\u5f84\uff0c\u53ef\u4ee5\u662f\u672c\u5730\u6587\u4ef6\u6216\u8005\u7f51\u7edc\u56fe\u7247\u3002<br \/>\u652f\u6301 PNG \u53ca JPG\uff0c\u663e\u793a\u56fe\u7247\u957f\u5bbd\u6bd4\u662f 1:1<\/td>\n<td style=\"text-align: left;\">\u9ed8\u8ba4\u4f7f\u7528\u5c0f\u7a0b\u5e8f Logo<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-javascript\">\/\/ page.js\nclass Index extends Component {\n  onShareTimeline () {\n    console.log(&#039;onShareTimeline&#039;)\n  }\n}<\/code><\/pre>\n<h4>componentWillPreload()<\/h4>\n<p>\u76ee\u524d\u53ea\u6709\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u652f\u6301<\/p>\n<p><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/taro-docs.jd.com\/taro\/docs\/best-practice#%E9%A2%84%E5%8A%A0%E8%BD%BD\" title=\"\u9884\u52a0\u8f7d\">\u9884\u52a0\u8f7d<\/a>\u94a9\u5b50<\/p>\n<h4>onTitleClick()<\/h4>\n<p>\u53ea\u6709\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u57fa\u7840\u5e93 1.3.0 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u70b9\u51fb\u6807\u9898\u89e6\u53d1<\/p>\n<h4>onOptionMenuClick()<\/h4>\n<p>\u53ea\u6709\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u57fa\u7840\u5e93 1.3.0 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u70b9\u51fb\u5bfc\u822a\u680f\u989d\u5916\u56fe\u6807\u89e6\u53d1<\/p>\n<h4>onPopMenuClick()<\/h4>\n<p>\u53ea\u6709\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u57fa\u7840\u5e93 1.11.0 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u6682\u65e0\u8bf4\u660e<\/p>\n<h4>onPullIntercept()<\/h4>\n<p>\u53ea\u6709\u652f\u4ed8\u5b9d\u5c0f\u7a0b\u5e8f\u652f\u6301\uff0c\u57fa\u7840\u5e93 1.3.0 \u5f00\u59cb\u652f\u6301<\/p>\n<p>\u4e0b\u62c9\u622a\u65ad\u65f6\u89e6\u53d1<\/p>\n<p>H5 \u6682\u65f6\u6ca1\u6709\u540c\u6b65\u5b9e\u73b0<code>onReachBottom<\/code>\u3001<code>onPageScroll<\/code>\u8fd9\u4e24\u4e2a\u4e8b\u4ef6\u51fd\u6570\uff0c\u53ef\u4ee5\u901a\u8fc7\u7ed9<code>window<\/code>\u7ed1\u5b9a<code>scroll<\/code>\u4e8b\u4ef6\u6765\u8fdb\u884c\u6a21\u62df\uff0c\u800c<code>onPullDownRefresh<\/code>\u4e0b\u62c9\u5237\u65b0\u5219\u6682\u65f6\u53ea\u80fd\u7528<code>ScrollView<\/code>\u7ec4\u4ef6\u6765\u4ee3\u66ff\u4e86\u3002<\/p>\n<blockquote>\n<p>\u6ce8\uff1a\u4ee5\u4e0a\u6210\u5458\u65b9\u6cd5\u5728 Taro \u7684\u9875\u9762\u4e2d\u540c\u6837\u53ef\u4ee5\u4f7f\u7528\uff0c\u4e66\u5199\u540c\u540d\u65b9\u6cd5\u5373\u53ef\uff0c\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\uff0c\u76ee\u524d\u6682\u65f6\u53ea\u6709\u5c0f\u7a0b\u5e8f\u7aef\u652f\u6301\uff08\u652f\u6301\u7a0b\u5ea6\u5982\u4e0a\uff09\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u7f16\u8bd1\u5230 H5\/RN \u7aef\u540e\u8fd9\u4e9b\u65b9\u6cd5\u5747\u4f1a\u5931\u6548\u3002<\/p>\n<\/blockquote>\n<h2>\u5185\u7f6e\u7ec4\u4ef6\/Props<\/h2>\n<p><code>Taro<\/code>\u4e2d\u4f7f\u7528<code>Vue<\/code>\uff0c\u5185\u7f6e\u7ec4\u4ef6\u9075\u5faa\u5c0f\u7a0b\u5e8f\u7ec4\u4ef6\u89c4\u8303\uff0c\u7ec4\u4ef6\u7684\u53c2\u6570\u548c\u5c0f\u7a0b\u5e8f\u53c2\u6570\u5b8c\u5168\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<h2>\u4e8b\u4ef6<\/h2>\n<p>\u4f7f\u7528<code>@<\/code>\u4fee\u9970\u7b26\uff08\u6216<code>v-on:<\/code>\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003Vue\u6587\u6863\uff09\u66ff\u4ee3\u5c0f\u7a0b\u5e8f\u4e8b\u4ef6\u4e2d\u7684<code>bind<\/code>\uff0c\u5728\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\u4e2d\u53ef\u4ee5\u7528<code>stopPropagation<\/code>\u963b\u6b62\u4e8b\u4ef6\u5192\u6ce1\uff1a<\/p>\n<pre><code class=\"language-html\">&lt;template&gt;\n  &lt;view&gt;\n    &lt;input v-model=&quot;number&quot; type=&quot;number&quot; class=&quot;input&quot; \/&gt;\n    &lt;button @tap=&quot;addNumber&quot;&gt;\n      Add new number\n    &lt;\/button&gt;\n  &lt;\/view&gt;\n&lt;\/template&gt;\n\n&lt;script&gt;\nexport default {\n  data() {\n    return {\n      number: 0\n    }\n  },\n  methods: {\n    addNumber(e) {\n      e.stopPropagation()\n    }\n  }\n}\n&lt;\/script&gt;<\/code><\/pre>\n<h2>\u5176\u5b83\u9650\u5236<\/h2>\n<ul>\n<li>\u7531\u4e8e\u5c0f\u7a0b\u5e8f\u8bbf\u95ee\u5143\u7d20\u4f4d\u7f6e\u4e3a\u5f02\u6b65 API\uff0c\u56e0\u6b64\u5c0f\u7a0b\u5e8f\u4e2d\u65e0\u6cd5\u4f7f\u7528\u5185\u7f6e\u7684<code>transition-group<\/code>\u7ec4\u4ef6<\/li>\n<li>\u5c0f\u7a0b\u5e8f\u4e2d\u4e0d\u652f\u6301<code>&lt;style scoped&gt;<\/code>\uff0c\u5efa\u8bae\u4f7f\u7528<code>cssModules<\/code>\u4ee3\u66ff<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728Taro\u53ef\u4ee5\u901a\u8fc7import Vue from &#039;vue&#039;\u6765\u4f7f\u7528Vue\uff0c\u4f46\u548c\u5728\u6d4f\u89c8\u5668\u4e2d\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,35],"tags":[328],"class_list":["post-1319","post","type-post","status-publish","format-standard","hentry","category-node","category-vue","tag-taro"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1319"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1319\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}