{"id":33560,"date":"2024-11-25T13:28:40","date_gmt":"2024-11-25T05:28:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33560\/"},"modified":"2024-11-25T13:28:40","modified_gmt":"2024-11-25T05:28:40","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e7%9a%84%e5%9f%ba%e7%a1%80%e7%9f%a5%e8%af%86%e5%82%a8%e5%a4%87","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33560\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u57fa\u7840\u77e5\u8bc6\u50a8\u5907"},"content":{"rendered":"<p><em><\/em> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>\u3010\u76f8\u5173\u5b66\u4e60\u63a8\u8350\uff1a\u3011<br \/><span><\/span><\/p>\n<h3>\u8d44\u6e90\u8def\u5f84\u8bf4\u660e<\/h3>\n<ul>\n<li>template\u5185\u5f15\u5165\u9759\u6001\u8d44\u6e90\uff0c\u5982image\u3001video\u7b49\u6807\u7b7e\u7684src\u5c5e\u6027\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u6216\u8005\u7edd\u5bf9\u8def\u5f84<\/li>\n<\/ul>\n<pre>&lt;!-- \u7edd\u5bf9\u8def\u5f84\uff0c\/static\u6307\u6839\u76ee\u5f55\u4e0b\u7684static\u76ee\u5f55\uff0c\u5728cli\u9879\u76ee\u4e2d\/static\u6307src\u76ee\u5f55\u4e0b\u7684static\u76ee\u5f55 --&gt;\n&lt;image&gt;&lt;\/image&gt;&lt;image&gt;&lt;\/image&gt;&lt;!-- \u76f8\u5bf9\u8def\u5f84 --&gt;&lt;image&gt;&lt;\/image&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>js\u6587\u4ef6\u6216script\u6807\u7b7e\u5185\uff08\u5305\u62ecrenderjs\u7b49\uff09\u5f15\u5165js\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u548c\u7edd\u5bf9\u8def\u5f84\u3002<strong>js\u6587\u4ef6\u4e0d\u652f\u6301\u4f7f\u7528\/\u5f00\u5934\u7684\u65b9\u5f0f\u5f15\u5165<\/strong> <\/li>\n<\/ul>\n<pre>\/\/&nbsp;\u7edd\u5bf9\u8def\u5f84\uff0c@\u6307\u5411\u9879\u76ee\u6839\u76ee\u5f55\uff0c\u5728cli\u9879\u76ee\u4e2d@\u6307\u5411src\u76ee\u5f55\nimport&nbsp;add&nbsp;from&nbsp;'@\/common\/add.js'\n\/\/&nbsp;\u76f8\u5bf9\u8def\u5f84\nimport&nbsp;add&nbsp;from&nbsp;'..\/..\/common\/add.js'<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>css\u6587\u4ef6\u6216style\u6807\u7b7e\u5185\u5f15\u5165css\u6587\u4ef6\u65f6\uff08scss\u3001less\u6587\u4ef6\u540c\u7406\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u548c\u7edd\u5bf9\u8def\u5f84\u3002<\/li>\n<\/ul>\n<pre>\/*&nbsp;\u7edd\u5bf9\u8def\u5f84&nbsp;*\/\n@import&nbsp;url('\/common\/uni.css');\n@import&nbsp;url('@\/common\/uni.css');\n\/*&nbsp;\u76f8\u5bf9\u8def\u5f84&nbsp;*\/\n@import&nbsp;url('..\/..\/common\/uni.css');<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>css\u6587\u4ef6\u6216style\u6807\u7b7e\u5185\u5f15\u7528\u7684\u56fe\u7247\u8def\u5f84\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u4e5f\u53ef\u4ee5\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6709\u4e9b\u5c0f\u7a0b\u5e8f\u7aefcss\u6587\u4ef6\u4e0d\u5141\u8bb8\u5f15\u7528\u672c\u5730\u6587\u4ef6<\/li>\n<\/ul>\n<pre>\/*&nbsp;\u7edd\u5bf9\u8def\u5f84&nbsp;*\/\nbackground-image:&nbsp;url(\/static\/logo.png);\nbackground-image:&nbsp;url(@\/static\/logo.png);\n\/*&nbsp;\u76f8\u5bf9\u8def\u5f84&nbsp;*\/\nbackground-image:&nbsp;url(..\/..\/static\/logo.png);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3> <span><\/span>\u751f\u547d\u5468\u671f<\/h3>\n<h4> <span><\/span>\u5e94\u7528\u751f\u547d\u5468\u671f<\/h4>\n<p><\/p>\n<table>\n<thead>\n<tr>\n<th>\u51fd\u6570\u540d<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>onLaunch<\/td>\n<td>\u5f53uni-app \u521d\u59cb\u5316\u5b8c\u6210\u65f6\u89e6\u53d1\uff08\u5168\u5c40\u53ea\u89e6\u53d1\u4e00\u6b21\uff09<\/td>\n<\/tr>\n<tr>\n<td>onShow<\/td>\n<td>\u5f53 uni-app \u542f\u52a8\uff0c\u6216\u4ece\u540e\u53f0\u8fdb\u5165\u524d\u53f0\u663e\u793a<\/td>\n<\/tr>\n<tr>\n<td>onHide<\/td>\n<td>\u5f53 uni-app \u4ece\u524d\u53f0\u8fdb\u5165\u540e\u53f0<\/td>\n<\/tr>\n<tr>\n<td>onError<\/td>\n<td>\u5f53 uni-app \u62a5\u9519\u65f6\u89e6\u53d1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4> <span><\/span>\u9875\u9762\u751f\u547d\u5468\u671f<\/h4>\n<p><\/p>\n<table>\n<thead>\n<tr>\n<th>\u51fd\u6570\u540d<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>onLoad<\/td>\n<td>\u76d1\u542c\u9875\u9762\u52a0\u8f7d\uff0c\u5176\u53c2\u6570\u4e3a\u4e0a\u4e2a\u9875\u9762\u4f20\u9012\u7684\u6570\u636e\uff0c\u53c2\u6570\u7c7b\u578b\u4e3aObject\uff08\u7528\u4e8e\u9875\u9762\u4f20\u53c2\uff09<\/td>\n<\/tr>\n<tr>\n<td>onShow<\/td>\n<td>\u76d1\u542c\u9875\u9762\u663e\u793a\u3002\u9875\u9762\u6bcf\u6b21\u51fa\u73b0\u5728\u5c4f\u5e55\u4e0a\u90fd\u89e6\u53d1\uff0c\u5305\u62ec\u4ece\u4e0b\u7ea7\u9875\u9762\u70b9\u8fd4\u56de\u9732\u51fa\u5f53\u524d\u9875\u9762<\/td>\n<\/tr>\n<tr>\n<td>onReady<\/td>\n<td>\u76d1\u542c\u9875\u9762\u521d\u6b21\u6e32\u67d3\u5b8c\u6210\u3002\u6ce8\u610f\u5982\u679c\u6e32\u67d3\u901f\u5ea6\u5feb\uff0c\u4f1a\u5728\u9875\u9762\u8fdb\u5165\u52a8\u753b\u5b8c\u6210\u524d\u89e6\u53d1<\/td>\n<\/tr>\n<tr>\n<td>onHide<\/td>\n<td>\u76d1\u542c\u9875\u9762\u9690\u85cf<\/td>\n<\/tr>\n<tr>\n<td>onUnload<\/td>\n<td>\u76d1\u542c\u9875\u9762\u5378\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>onResize<\/td>\n<td>\u76d1\u542c\u7a97\u53e3\u5c3a\u5bf8\u53d8\u5316<\/td>\n<\/tr>\n<tr>\n<td>onPullDownRefresh<\/td>\n<td>\u76d1\u542c\u7528\u6237\u4e0b\u62c9\u52a8\u4f5c\uff0c\u4e00\u822c\u7528\u4e8e\u4e0b\u62c9\u5237\u65b0<\/td>\n<\/tr>\n<tr>\n<td>onReachBottom<\/td>\n<td>\u9875\u9762\u4e0a\u62c9\u89e6\u5e95\u4e8b\u4ef6\u7684\u5904\u7406\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>onTabItemTap<\/td>\n<td>\u70b9\u51fb tab \u65f6\u89e6\u53d1\uff0c\u53c2\u6570\u4e3aObject<\/td>\n<\/tr>\n<tr>\n<td>onShareAppMessage<\/td>\n<td>\u7528\u6237\u70b9\u51fb\u53f3\u4e0a\u89d2\u5206\u4eab<\/td>\n<\/tr>\n<tr>\n<td>onPageScroll<\/td>\n<td>\u76d1\u542c\u9875\u9762\u6eda\u52a8\uff0c\u53c2\u6570\u4e3aObject<\/td>\n<\/tr>\n<tr>\n<td>onNavigationBarButtonTap<\/td>\n<td>\u76d1\u542c\u539f\u751f\u6807\u9898\u680f\u6309\u94ae\u70b9\u51fb\u4e8b\u4ef6\uff0c\u53c2\u6570\u4e3aObject<\/td>\n<\/tr>\n<tr>\n<td>onBackPress<\/td>\n<td>\u76d1\u542c\u9875\u9762\u8fd4\u56de\uff0c\u8fd4\u56de event = {from:backbutton\u3001 navigateBack} \uff0cbackbutton \u8868\u793a\u6765\u6e90\u662f\u5de6\u4e0a\u89d2\u8fd4\u56de\u6309\u94ae\u6216 android \u8fd4\u56de\u952e\uff1bnavigateBack\u8868\u793a\u6765\u6e90\u662f uni.navigateBack<\/td>\n<\/tr>\n<tr>\n<td>onNavigationBarSearchInputChanged<\/td>\n<td>\u76d1\u542c\u539f\u751f\u6807\u9898\u680f\u641c\u7d22\u8f93\u5165\u6846\u8f93\u5165\u5185\u5bb9\u53d8\u5316\u4e8b\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>onNavigationBarSearchInputConfirmeds<\/td>\n<td>\u76d1\u542c\u539f\u751f\u6807\u9898\u680f\u641c\u7d22\u8f93\u5165\u6846\u641c\u7d22\u4e8b\u4ef6\uff0c\u7528\u6237\u70b9\u51fb\u8f6f\u952e\u76d8\u4e0a\u7684\u201c\u641c\u7d22\u201d\u6309\u94ae\u65f6\u89e6\u53d1<\/td>\n<\/tr>\n<tr>\n<td>onNavigationBarSearchInputClicked<\/td>\n<td>\u76d1\u542c\u539f\u751f\u6807\u9898\u680f\u641c\u7d22\u8f93\u5165\u6846\u70b9\u51fb\u4e8b\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4> <span><\/span>Vue\u751f\u547d\u5468\u671f<\/h4>\n<p><\/p>\n<table>\n<thead>\n<tr>\n<th>\u51fd\u6570\u540d<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>beforeCreate<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>created<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>beforeMount<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>mounted<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>beforeUpdate<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>updated<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>beforeDestroy<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>destroyed<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3> <span><\/span>\u8def\u7531<\/h3>\n<p>uni-app\u8def\u7531\u7edf\u4e00\u6709\u6846\u67b6\u7ba1\u7406\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5728pages.json\u91cc\u914d\u7f6e\u6bcf\u4e2a\u8def\u7531\u9875\u9762\u7684\u8def\u5f84\u53ca\u9875\u9762\u6837\u5f0f\u3002\u5982\u4ecd\u5e0c\u671b\u91c7\u7528 Vue Router \u65b9\u5f0f\u7ba1\u7406\u8def\u7531\uff0c\u53ef\u5728\u63d2\u4ef6\u5e02\u573a\u641c\u7d22 Vue-Router\u3002<\/p>\n<h4> <span><\/span>\u8def\u7531\u8df3\u8f6c<\/h4>\n<p>uni-app \u6709\u4e24\u79cd\u9875\u9762\u8def\u7531\u8df3\u8f6c\u65b9\u5f0f\uff1a\u4f7f\u7528navigator\u7ec4\u4ef6\u8df3\u8f6c\u3001\u8c03\u7528API\u8df3\u8f6c<\/p>\n<p>\u9875\u9762\u6808<\/p>\n<p><\/p>\n<table>\n<thead>\n<tr>\n<th>\u8def\u7531\u65b9\u5f0f<\/th>\n<th>\u9875\u9762\u6808\u8868\u73b0<\/th>\n<th>\u89e6\u53d1\u65f6\u673a<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u521d\u59cb\u5316<\/td>\n<td>\u65b0\u9875\u9762\u5165\u6808<\/td>\n<td>uni-app \u6253\u5f00\u7684\u7b2c\u4e00\u4e2a\u9875\u9762<\/td>\n<\/tr>\n<tr>\n<td>\u6253\u5f00\u65b0\u9875\u9762<\/td>\n<td>\u65b0\u9875\u9762\u5165\u6808<\/td>\n<td>\u8c03\u7528 API &nbsp; uni.navigateTo &nbsp;\u3001\u4f7f\u7528\u7ec4\u4ef6 &nbsp; <\/td>\n<\/tr>\n<tr>\n<td>\u9875\u9762\u91cd\u5b9a\u5411<\/td>\n<td>\u5f53\u524d\u9875\u9762\u51fa\u6808\uff0c\u65b0\u9875\u9762\u5165\u6808<\/td>\n<td>\u8c03\u7528 API &nbsp; uni.redirectTo &nbsp;\u3001\u4f7f\u7528\u7ec4\u4ef6 &nbsp; <\/td>\n<\/tr>\n<tr>\n<td>\u9875\u9762\u8fd4\u56de<\/td>\n<td>\u9875\u9762\u4e0d\u65ad\u51fa\u6808\uff0c\u76f4\u5230\u76ee\u6807\u8fd4\u56de\u9875<\/td>\n<td>\u8c03\u7528 API &nbsp;uni.navigateBack &nbsp; \u3001\u4f7f\u7528\u7ec4\u4ef6 \u3001\u7528\u6237\u6309\u5de6\u4e0a\u89d2\u8fd4\u56de\u6309\u94ae\u3001\u5b89\u5353\u7528\u6237\u70b9\u51fb\u7269\u7406back\u6309\u952e <\/td>\n<\/tr>\n<tr>\n<td>Tab \u5207\u6362<\/td>\n<td>\u9875\u9762\u5168\u90e8\u51fa\u6808\uff0c\u53ea\u7559\u4e0b\u65b0\u7684 Tab \u9875\u9762<\/td>\n<td>\u8c03\u7528 API &nbsp;uni.switchTab &nbsp;\u3001\u4f7f\u7528\u7ec4\u4ef6 &nbsp; &nbsp;\u3001\u7528\u6237\u5207\u6362 Tab <\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u52a0\u8f7d<\/td>\n<td>\u9875\u9762\u5168\u90e8\u51fa\u6808\uff0c\u53ea\u7559\u4e0b\u65b0\u7684\u9875\u9762<\/td>\n<td>\u8c03\u7528 API &nbsp;uni.reLaunch &nbsp;\u3001\u4f7f\u7528\u7ec4\u4ef6 &nbsp; <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd0\u884c\u73af\u5883\u5224\u65ad<\/p>\n<pre>\/\/&nbsp;uEnvDev\nif&nbsp;(process.env.NODE_ENV&nbsp;===&nbsp;'development')&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;TODO\n}\n\/\/&nbsp;uEnvProd\nif&nbsp;(process.env.NODE_ENV&nbsp;===&nbsp;'production')&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;TODO\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3> <span><\/span>\u9875\u9762\u6837\u5f0f\u4e0e\u5e03\u5c40<\/h3>\n<h4> <span><\/span>\u5355\u4f4d<\/h4>\n<p>px\u4e3a\u5c4f\u5e55\u50cf\u7d20,rpx\u54cd\u5e94\u5f0fpx,\u5b83\u4eec\u4e4b\u95f4\u7684\u6362\u7b97\u516c\u5f0f\u4e3a750 * \u5143\u7d20\u5728\u8bbe\u8ba1\u7a3f\u4e2d\u7684\u5bbd\u5ea6 \/ \u8bbe\u8ba1\u7a3f\u57fa\u51c6\u5bbd\u5ea6<\/p>\n<h4> <span><\/span>\u6837\u5f0f\u5bfc\u5165<\/h4>\n<pre>&lt;style&gt;\n    @import \"..\/..\/common\/uni.css\";\n    .uni-card {\n        box-shadow: none;\n    }&lt;\/style&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h4> <span><\/span>flex\u5e03\u5c40<\/h4>\n<pre>&lt;style&gt;\/*\u4e3b\u8981\u6709\u4e24\u4e2a\u6982\u5ff5 \u5bb9\u5668\u4e0e\u9879\u76ee*\/\n .container{\n    display: flex; \n    flex-direction:row;\n    flex-wrap:nowrap;\n    flex-flow: row nowrap;\/*\u7b80\u5199\u65b9\u5f0f*\/\n    justify-content: center;\/*\u5b9a\u4e49\u9879\u76ee\u5728\u4e3b\u8f74\u4e0a\u7684\u5bf9\u9f50\u65b9\u5f0f*\/\n    align-items:center;\/*\u5b9a\u4e49\u9879\u76ee\u5728\u4ea4\u53c9\u8f74\u4e0a\u5982\u4f55\u5bf9\u9f50*\/}.item {\n  order: 1;\n  flex-grow:0;\/*\u5b9a\u4e49\u9879\u76ee\u7684\u653e\u5927\u6bd4\u4f8b*\/\n  flex-shrink:1;\/*\u5b9a\u4e49\u4e86\u9879\u76ee\u7684\u7f29\u5c0f\u6bd4\u4f8b*\/\n  align-self:auto;\/*\u5355\u4e2a\u9879\u76ee\u6709\u4e0e\u5176\u4ed6\u9879\u76ee\u4e0d\u4e00\u6837\u7684\u5bf9\u9f50\u65b9\u5f0f*\/}&lt;\/style&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3> <span><\/span>\u5b9a\u4e49\u5168\u5c40\u53d8\u91cf<\/h3>\n<ul>\n<li>\u5171\u7528\u6a21\u5757<\/li>\n<li>Vue.prototype<\/li>\n<li>globalData<\/li>\n<li>Vuex<\/li>\n<\/ul>\n<p>\u53c2\u8003\u6587\u7ae0 uni-app\u5168\u5c40\u53d8\u91cf\u7684\u51e0\u79cd\u5b9e\u73b0\u65b9\u5f0f<\/p>\n<h3> <span><\/span>class\u4e0estyle\u7ed1\u5b9a<\/h3>\n<p>\u652f\u6301\u6570\u7ec4\u5408\u5bf9\u8c61\u7684\u65b9\u5f0f<\/p>\n<h3> <span><\/span>\u8ba1\u7b97\u5c5e\u6027<\/h3>\n<p>\u8ba1\u7b97\u5c5e\u6027\u662f\u57fa\u4e8e\u5b83\u4eec\u7684\u54cd\u5e94\u5f0f\u4f9d\u8d56\u8fdb\u884c\u7f13\u5b58\u7684<\/p>\n<h3> <span><\/span>\u6761\u4ef6\u6e32\u67d3<\/h3>\n<p>v-if v-show<\/p>\n<h3> <span><\/span>\u5217\u8868\u6e32\u67d3<\/h3>\n<p>v-for \u6ce8\u610f\u643a\u5e26key<\/p>\n<h3> <span><\/span>\u4e8b\u4ef6\u5904\u7406<\/h3>\n<pre>\/\/&nbsp;\u4e8b\u4ef6\u6620\u5c04\u8868\uff0c\u5de6\u4fa7\u4e3a&nbsp;WEB&nbsp;\u4e8b\u4ef6\uff0c\u53f3\u4fa7\u4e3a&nbsp;``uni-app``&nbsp;\u5bf9\u5e94\u4e8b\u4ef6{\n&nbsp;&nbsp;&nbsp;&nbsp;click:&nbsp;'tap',\n&nbsp;&nbsp;&nbsp;&nbsp;touchstart:&nbsp;'touchstart',\n&nbsp;&nbsp;&nbsp;&nbsp;touchmove:&nbsp;'touchmove',\n&nbsp;&nbsp;&nbsp;&nbsp;touchcancel:&nbsp;'touchcancel',\n&nbsp;&nbsp;&nbsp;&nbsp;touchend:&nbsp;'touchend',\n&nbsp;&nbsp;&nbsp;&nbsp;tap:&nbsp;'tap',\n&nbsp;&nbsp;&nbsp;&nbsp;longtap:&nbsp;'longtap',&nbsp;\/\/\u63a8\u8350\u4f7f\u7528longpress\u4ee3\u66ff\n&nbsp;&nbsp;&nbsp;&nbsp;input:&nbsp;'input',\n&nbsp;&nbsp;&nbsp;&nbsp;change:&nbsp;'change',\n&nbsp;&nbsp;&nbsp;&nbsp;submit:&nbsp;'submit',\n&nbsp;&nbsp;&nbsp;&nbsp;blur:&nbsp;'blur',\n&nbsp;&nbsp;&nbsp;&nbsp;focus:&nbsp;'focus',\n&nbsp;&nbsp;&nbsp;&nbsp;reset:&nbsp;'reset',\n&nbsp;&nbsp;&nbsp;&nbsp;confirm:&nbsp;'confirm',\n&nbsp;&nbsp;&nbsp;&nbsp;columnchange:&nbsp;'columnchange',\n&nbsp;&nbsp;&nbsp;&nbsp;linechange:&nbsp;'linechange',\n&nbsp;&nbsp;&nbsp;&nbsp;error:&nbsp;'error',\n&nbsp;&nbsp;&nbsp;&nbsp;scrolltoupper:&nbsp;'scrolltoupper',\n&nbsp;&nbsp;&nbsp;&nbsp;scrolltolower:&nbsp;'scrolltolower',\n&nbsp;&nbsp;&nbsp;&nbsp;scroll:&nbsp;'scroll'}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3> <span><\/span>\u8868\u5355\u63a7\u4ef6\u7ed1\u5b9a<\/h3>\n<p>\u63a8\u8350\u4f7f\u7528uni-app\u7684\u8868\u5355\u7ec4\u4ef6<\/p>\n<h3> <span><\/span>\u7ec4\u4ef6\u5206\u4e3a\u5168\u5c40\u7ec4\u4ef6\u548c\u5c40\u90e8\u7ec4\u4ef6<\/h3>\n<p>\u90fd\u5b58\u5728\u7c7b\u4f3c\u7684\u64cd\u4f5c\uff0c\u5373\u5bfc\u5165\uff0c\u6ce8\u518c\uff0c\u4f7f\u7528<\/p>\n<h3> <span><\/span>\u5e38\u89c1\u95ee\u9898<\/h3>\n<p>1\u3001\u5982\u4f55\u83b7\u53d6\u4e0a\u4e2a\u9875\u9762\u4f20\u9012\u7684\u6570\u636e<br \/>onLoad(args)<br \/>2\u3001\u5982\u4f55\u8bbe\u7f6e\u5168\u5c40\u7684\u6570\u636e\u548c\u5168\u5c40\u7684\u65b9\u6cd5<br \/>vuex(uni-app\u5df2\u7ecf\u5185\u7f6e\u4e86vuex)<\/p>\n<h3> <span><\/span>uni-app\u81ea\u5e26\u7edf\u8ba1\u5e73\u53f0\uff0c\u53ea\u8981\u7a0d\u4f5c\u914d\u5236\u5c31\u53ef\u4ee5\u4f7f\u7528<\/h3>\n<p>uni\u7edf\u8ba1\u5b98\u7f51\u5730\u5740\uff1atongji.dcloud.net.cn\/<span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u57fa\u7840\u77e5\u8bc6\u50a8\u5907\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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u3010\u76f8\u5173\u5b66\u4e60\u63a8\u8350\uff1a\u3011 \u8d44\u6e90\u8def\u5f84\u8bf4\u660e template\u5185\u5f15\u5165\u9759\u6001\u8d44\u6e90\uff0c\u5982image\u3001video\u7b49\u6807\u7b7e\u7684src\u5c5e\u6027\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u6216\u8005\u7edd\u5bf9\u8def\u5f84 &lt;!&#8211; \u7edd\u5bf9\u8def\u5f84\uff0c\/static\u6307\u6839\u76ee\u5f55\u4e0b\u7684static\u76ee\u5f55\uff0c\u5728cli\u9879\u76ee\u4e2d\/static\u6307src\u76ee\u5f55\u4e0b\u7684static\u76ee\u5f55 &#8211;&gt; &lt;image&gt;&lt;\/image&gt;&lt;image&gt;&lt;\/image&gt;&lt;!&#8211; \u76f8\u5bf9\u8def\u5f84 &#8211;&gt;&lt;image&gt;&lt;\/image&gt; \u767b\u5f55\u540e\u590d\u5236 js\u6587\u4ef6\u6216script\u6807\u7b7e\u5185\uff08\u5305\u62ecrenderjs\u7b49\uff09\u5f15\u5165js\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u548c\u7edd\u5bf9\u8def\u5f84\u3002js\u6587\u4ef6\u4e0d\u652f\u6301\u4f7f\u7528\/\u5f00\u5934\u7684\u65b9\u5f0f\u5f15\u5165 \/\/&nbsp;\u7edd\u5bf9\u8def\u5f84\uff0c@\u6307\u5411\u9879\u76ee\u6839\u76ee\u5f55\uff0c\u5728cli\u9879\u76ee\u4e2d@\u6307\u5411src\u76ee\u5f55 import&nbsp;add&nbsp;from&nbsp;&#8216;@\/common\/add.js&#8217; \/\/&nbsp;\u76f8\u5bf9\u8def\u5f84 import&nbsp;add&nbsp;from&nbsp;&#8216;..\/..\/common\/add.js&#8217; \u767b\u5f55\u540e\u590d\u5236 css\u6587\u4ef6\u6216style\u6807\u7b7e\u5185\u5f15\u5165css\u6587\u4ef6\u65f6\uff08scss\u3001less\u6587\u4ef6\u540c\u7406\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u548c\u7edd\u5bf9\u8def\u5f84\u3002 \/*&nbsp;\u7edd\u5bf9\u8def\u5f84&nbsp;*\/ @import&nbsp;url(&#8216;\/common\/uni.css&#8217;); @import&nbsp;url(&#8216;@\/common\/uni.css&#8217;); \/*&nbsp;\u76f8\u5bf9\u8def\u5f84&nbsp;*\/ @import&nbsp;url(&#8216;..\/..\/common\/uni.css&#8217;); \u767b\u5f55\u540e\u590d\u5236 css\u6587\u4ef6\u6216style\u6807\u7b7e\u5185\u5f15\u7528\u7684\u56fe\u7247\u8def\u5f84\u53ef\u4ee5\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u4e5f\u53ef\u4ee5\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6709\u4e9b\u5c0f\u7a0b\u5e8f\u7aefcss\u6587\u4ef6\u4e0d\u5141\u8bb8\u5f15\u7528\u672c\u5730\u6587\u4ef6 \/*&nbsp;\u7edd\u5bf9\u8def\u5f84&nbsp;*\/ background-image:&nbsp;url(\/static\/logo.png); background-image:&nbsp;url(@\/static\/logo.png); \/*&nbsp;\u76f8\u5bf9\u8def\u5f84&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-33560","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33560","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=33560"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33560\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}