Write in the front: wechat small program in the front end of the market is very popular, thanks to its convenience, so master it becomes an indispensable step for you to move to a higher level.Copy the code
Small program must learn knowledge:
I. wechat developer tools
Two, small program framework:
1. Tencent Wepy is similar to VUE 2, Meituan MPVue is similar to Vue 3, Jingdong Taro is similar to React 4, Didi Chameleon 5, Uni-App is similar to Vue 6, small program native frameworkCopy the code
Small program template syntax
Four, * applets built-in components
Five, small program life cycle
Six, * small program custom components
Hit the pit age:
Applets adaptation problem:
The applet stipulates that the screen width and height of all devices should be 750rpx, which is 375px. The applet recommends using 'RPX' units so that you can adapt to any screen.Copy the code
-
Pt: Visual units (units of length) related to the physical screen size of the device, also called logical resolution (logical units), related to raster rendering on the mobile end.
-
Px: the physical resolution of the pixels does not change as the screen changes; Generally, designers give designs in physical resolution units, that is, the iPhone6 resolution is 375, but the design is 750; Because RPX: px == 2:1, the design of the small program should be based on the iPhone6.
Navigation jump problem:
NavigateTo /redirectTo cannot jump to a page in the tarBar. 2, Use switchTab, switchTab is used to jump to a page in the tarBarCopy the code
Custom component table:
Small application form at https://github.com/kawaiiz/table_componentCopy the code
Applets API encapsulation:
Subsequent updatesCopy the code