Applet development Technical Summary (wepy)

 

Creating wepy project

  • Global install or update WePY command-line tool:npm install wepy-cli -g
  • Demo generation development projects in the development directory:wepy new myproject , 1.7.0之后的版本使用 wepy init standard myproject 初始化项目,使用 wepy list 查看项目模板
  • Changes to the project directory:cd myproject
  • Installation depends:npm install
  • Open real-time compilation:wepy build --watch(也可以npm run dev,详细查看package.json)

wepy locally run projects as follows:

First gitLab take the code, enter the root directory npm install, then npm run dev generate dist file in Developer Tools to open the applet project commissioning, project selection dist directory, you can see real-time debugging effect

2. Project Contents Introduction:

 
image.png

Vue worked on the case, the configuration is very similar

3. Project on line Note:

4. How small test program:

  • Developers self-test Note: To turn off developer tools ES6 turn ES5, otherwise wepy compiler will complain, if needed or requested domain name need to use web-wiew domain, the background is not set up a secure connection, open the Settings tool (not check legal domain name (domain name service), TLS and HTTPS version of web-view certificate)


     
    image.png
  • The testers to developers, not the developer can not enter the development board, while the phone is open debug mode, you can approach a small program trial version, trial version below vclone can see information

5. I wrote a small program code configured:

Project app.wepy common configuration on the inside, including authorization, authentication, and access to user information
request link with the project context switches, the company in order to solve the real host of restrictions can only change once a month, to engage in a peanut shell domain, different environment point to a different domain name, so did not need a switch environment, it is necessary to change the domain name back applets, too much trouble

6.wepy of a pit, the pit is in fact accurate to say a small program
in the course of the project, found that there is a details page rendering speed is surprisingly slow, because the page data structure is very complex, a lot of processing logic, so I suspect that the data processing performance issues, but not the actual data processing proved time-consuming, but wepy of dirty checking is time-consuming (apply ()), and sometimes even more than the 20s, so I gave wepy the apply (), use a small program setData (), the problem also exists, because that is the page too much data, convert the data to a string length even some of them have more than 1 million, and is not slow on the strange. . . . The problem solution can only be dated back data structure as simple as possible, the hierarchy as possible, the amount of data as possible .....
details Reference: https://github.com/Tencent/wepy/issues/1090 , the chiefs are given detailed reasons, while optimizing the authors in this regard during 2.0

Related documents:

Applet: https://developers.weixin.qq.com/miniprogram/dev/

Wepy:https://tencent.github.io/wepy/document.html

In addition, the program found a small bug: when input components on a normal debugging tool, but a preview on the phone or trial version, move the cursor to the top, click Delete, e.detail.value becomes empty, and ask the community The official, obviously a bug (manual nugget) ... . bug link: https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=000e824805c778b810175857a5b000&commentid=0002605d888ff0ea6d1700b69510&token=425717196&lang=zh_CN

 

Reprinted: https://www.jianshu.com/p/be77689b6727

Guess you like

Origin www.cnblogs.com/zmdComeOn/p/11583649.html