Learn the small program…
Small programs, fast applications and so on have now become the first choice for many companies to try new businesses or drainage, understanding and learning it, has become a necessity. No more nonsense, first come:
The name of the | content |
---|---|
The source code | Github.com/ofoer/mp-ao… |
Demo address |
I think I can remember. Welcome to star
Basic knowledge of
Relative to Web development, small program development mainly introduces the following concepts or file types
wxss
(This is web CSS, but only some properties are not implemented)wxml
(Similar to HTML syntax, used to build pages, but only the tags it provides are supported)- image
- view
- As shown in the component
wxs
(A bit of javascript, but a lot of different, used to handle some data logic during WXML rendering, just like JSX can write expressions before rendering, but the syntax is different)**.js
Main processing logicproject.config.json
The main configuration of the project relative to the applets, and the configuration of the development tools are stored in this file**.json
A large number of JSON files are used in the applet to configure itemscomponents
Very different components from React and Vuecomponentsrpx
Unit, the size unit unique to small programs, RPX (responsive Pixel) : can be adapted according to the screen width. Set the screen width to 750rpx. For example, on the iPhone6, if the screen is 375px wide and there are 750 physical pixels, then 750rpx = 375px = 750 physical pixels and 1rpx = 0.5px = 1 physical pixel.
equipment | RPX convert px (screen width /750) | Px conversion RPX (750/ screen width) |
---|---|---|
iPhone5 | 1 the RPX = 0.42 px | 1 px = 2.34 the RPX |
iPhone6 | 1 the RPX = 0.5 px | 1px = 2rpx |
iPhone6 Plus | 1 the RPX = 0.552 px | 1 px = 1.81 the RPX |
Understand the above basic knowledge, you can be happy to develop small programs, relative to the front-end development, very simple, everyone quickly put their own Olympic small program.