Home > Article > WeChat Applet > A little personal summary about developing mini programs on WeChat
I have some personal opinions on the development of WeChat Mini Programs. Currently I mainly write about: the difference between WeChat Mini Programs and H5, and the things to note when developing WeChat Mini Programs
The difference between WeChat Mini Programs and H5
Different operating environments
The operating environment of H5 is the browser and mobile webview, while the WeChat applet is a product of a React Native-like framework developed by WeChat itself. Its characteristics are: If you need to update the WeChat app, the mini program can update itself!
The difference in obtaining system permissions
First of all, we must admit that the WeChat applet is the biological son of WeChat, while H5 belongs to someone else. Therefore, the WeChat applet can obtain permissions. Direct API calls, while H5 needs to be adapted, for example, data storage, WeChat sharing, etc.
Different fluency
There is actually nothing to say about this. As I said above, one is a biological son, one is from someone else’s family, plus WeChat’s related platform specially developed for small programs, Therefore, the smoothness of WeChat Mini Program is much better than that of H5
API, framework, and components are different
WXSS and WXML of WeChat Mini Program were born out of H5’s HTML and CSS, but they are not the original versions Although copied, there are differences in many places. For example, many components of WeChat mini programs are written by ourselves and are not compatible with H5. Therefore, we should pay attention to checking the official development documents first during the development process.
Notes on developing small programs
Read the official development documents carefully and pay attention to version updates, because the birth time of small programs is relatively short, so there are many things that are still needed Changes, so it is possible that what you were still using in the previous version will be obsolete in the next version.
The WeChat applet is not H5, so you cannot copy the H5 code and use it directly. Please pay attention when operating certain components and WXSS. For example, when I query the display attribute in the CSS style of H5, it defaults to inline, but when I use WeChat The mini program utility tool query found that it is a block, and the component is not suitable and cannot be recognized.
Although the WeChat applet also uses js, some js functions cannot be used. For example, the node acquisition call of the WeChat applet does not respond! After my inquiry, I found that the WeChat applet cannot use DOM operations. For the applet, all its changes are driven by data!
Please pay attention to the upload size limit of WeChat mini program. Be careful if it exceeds the limit, it will not be fun!
We have only found so many at present, and we will gradually improve them when we find out in the future!
The above is the detailed content of A little personal summary about developing mini programs on WeChat. For more information, please follow other related articles on the PHP Chinese website!