WeChat Mini Program Development Guide: Notes and Common Shortcut Keys

高洛峰
Release: 2017-03-04 14:22:28
Original
1362 people have browsed it

Points of note

1. The official definition of WeChat Mini Program is: WeChat Mini Program is an application that can be used without downloading and installation. It realizes the dream of "within reach" of applications. , users can open the application by scanning or searching. In fact, it is more like a WEB APP. Users can open a WeChat applet just like opening a web page. Therefore, WeChat’s requirement for mini programs is that the overall size cannot exceed 1MB.
2. .json is a configuration file, and its content must conform to JSON format, so no comments are allowed inside the file.
3. app.json is a global configuration file. The [path + page name] of each page in the WeChat applet needs to be written in the pages of app.json, and the first page in the pages is the applet. Home page
4. The .wxss file is a style sheet file, and app.wxss is a global style sheet file. The page's style sheet is optional. When there is a page style sheet, the style rules in the page's style sheet will cascade over the style rules in app.wxss. If you do not specify the style sheet of the page, you can also directly use the style rules specified in app.wxss in the structure file of the page. .json files have the same rules.
5. The path name and file name of each page must be the same.
6. The tabBar (the tab bar at the bottom of the client window used to switch pages) is configured in the app.json file. Only a minimum of 2 and a maximum of 5 tabs can be configured. The display order is the same as the pei under the tabBar label
7. The iconPath and selectedIconPath attributes of tabBar can accept the path of an image. This image must be a local image and not a network image.
8. It is best to use rpx as the pixel unit, WeChat will adapt according to the size of the mobile phone screen.
9. To store resource files in the WeChat applet, you need to create a folder in the root directory and reference it in the form of /folder name/resource name.
10. An application can only open 5 pages at the same time. Opening a page with wx.navigateTo will not destroy the previous page. If there are many pages, please use wx.redirectTo.

Shortcut keys

Format adjustment
- Ctrl+S: Save file
- Ctrl+[, Ctrl+]: Code line indentation
- Ctrl+Shift+[, Ctrl +Shift+]: Fold and open the code block
- Ctrl+C Ctrl+V: Copy and paste, if no text is selected, copy and paste a line
- Shift+Alt+F: Code formatting
- Alt+ Up, Alt+Down: Move a line up and down
- Shift+Alt+Up, Shift+Alt+Down: Copy a line up and down
- Ctrl+Shift+Enter: Insert a line above the current line

Cursor related
- Ctrl+End: Move to the end of the file
- Ctrl+Home: Move to the beginning of the file
- Ctrl+i: Select the current line
- Shift+End: Select from the cursor To the end of the line
- Shift+Home: Select from the beginning of the line to the cursor
- Ctrl+Shift+L: Select all matches
- Ctrl+D: Select the match
- Ctrl+U: Cursor Fallback

Interface related
- Ctrl + \: Hide sidebar
- Ctrl + m: Open or hide the simulator

More WeChat applet development guide: Note For articles related to point and common shortcut keys, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!