[占山为王]我是如何四步将一个微信小程序请求库改成Taro的

<section id="nice" data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="font-size: 16px; color: black; padding: 0 10px; line-height: 1.6; word-spacing: 0px; letter-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: #ffb11b; background: #fff5e3;"> <p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; padding: 0; margin: 0px; line-height: 26px; color: #595959;">本项目中的第三方库作者不再维护,fork后自己进行的维护,如有侵权立刻删除!</p> </blockquote> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;">憨憨本憨,快速开源项目,占山为王。<br> 如何做一个优秀的开源贡献者,只需要四步。</p> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第一步 clone 一个 微信小程序请求库</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://github.com/notbucai/wechat-request" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">wechat-request</a></p> <pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #272822; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #ddd; display: block; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #272822; border-radius: 5px;"><span class="hljs-meta" style="color: #75715e; line-height: 26px;">$</span><span class="bash" style="line-height: 26px;"> git <span class="hljs-built_in" style="color: #a6e22e; line-height: 26px;">clone</span> git@github.com:notbucai/wechat-request.git</span> <span/></code></pre> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第二步 改变主要代码</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;">将<code style="font-size: 14px; word-wrap: break-word; border-radius: 4px; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #9b6e23; background-color: #fff5e3; padding: 3px; margin: 3px;">wx.request</code>改成<code style="font-size: 14px; word-wrap: break-word; border-radius: 4px; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #9b6e23; background-color: #fff5e3; padding: 3px; margin: 3px;">Taro.request</code>;</p> <blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: #ffb11b; background: #fff5e3;"> <p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; padding: 0; margin: 0px; line-height: 26px; color: #595959;">dispatchRequest.js -&gt; 34行左右</p> </blockquote> <figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;"><img src="https://user-gold-cdn.xitu.io/2020/7/17/1735bdf87e595143?w=2048&amp;h=1536&amp;f=png&amp;s=461422" alt style="margin: 0 auto; max-width: 100%; width: 100%; border-radius: 5px; display: block; margin-bottom: 15px; height: auto;"></figure> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第三步 改package.json</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;">改个名字 改个版本 <img src="https://user-gold-cdn.xitu.io/2020/7/17/1735be04ca370ce9?w=1300&amp;h=916&amp;f=png&amp;s=130608" alt style="margin: 0 auto; max-width: 100%; width: 100%; border-radius: 5px; display: block; margin-bottom: 15px; height: auto;"></p> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第四步 发布包</span><span class="suffix"></span></h2> <pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #272822; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #ddd; display: block; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #272822; border-radius: 5px;"><span class="hljs-meta" style="color: #75715e; line-height: 26px;">$</span><span class="bash" style="line-height: 26px;"> npm publish --access=public</span> <span/></code></pre> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">项目引入</span><span class="suffix"></span></h2> <pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #272822; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #ddd; display: block; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #272822; border-radius: 5px;"><span class="hljs-meta" style="color: #75715e; line-height: 26px;">$</span><span class="bash" style="line-height: 26px;"> npm install @bucai/taro-request</span> <span/></code></pre> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">END</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://github.com/notbucai/wechat-request" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">wechat-request</a></p> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://github.com/notbucai" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">GitHub</a></p> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://notbucai.com/" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">blog</a></p> <p id="nice-suffix-juejin-container" class="nice-suffix-juejin-container" data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a; margin-top: 20px !important;">本文使用 <a href="https://mdnice.com/?from=juejin" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">mdnice</a> 排版</p></section>
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

swap空间的增减方法

(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap