Home  >  Article  >  WeChat Applet  >  Detailed explanation of WeChat mini program development skills and development tool usage skills

Detailed explanation of WeChat mini program development skills and development tool usage skills

迷茫
迷茫Original
2017-03-25 16:32:401449browse

1: Development skills

1. All pages need to be in the app. The pages in the json file are registered in the form of [path + page name] (the page name does not need to add a file extension)

2. The first one registered in the pages in the file app.json The page is the homepage of the mini program

3. The js, json, wxml, and wxss files of each page must have the same path and file name

4. Directly modifying this.data in the js file is invalid. Please use this.setData() function.

5. The data set once using this.setData() function cannot be used. More than 1024kB

6. The mini program currently does not support the direct introduction of node_modules. When developers need to use node_modules, it is recommended to copy the relevant code to the directory of the mini program

7. Data can be defined in the component, starting with data-. Multiple words are linked by hyphens -. Uppercase characters will be automatically converted to lowercase and passed to the logic layer through events

8. All components and attributes are in lower case and connected with hyphens

9. Mini programs can only open up to five pages at the same time

10. The mini program must send a request using the https protocol, and the request address must register a secure domain name under the corresponding appid

11. It is not allowed in the mini program script Using window, components cannot be operated in scripts

12. In order to improve the smoothness of the experience, the size of the compiled code package must be less than 1MB. Code packages larger than 1MB will fail to be uploaded

13. Use the page tag selector to modify the style of the top-level node, similar to the body tag in HTML

2: Skills in using development tools

Shortcut keys


Format adjustment


##Ctrl+S: Save file


##Ctrl+[, Ctrl+] : Code line indentation

Ctrl+Shift+[, Ctrl+Shift+]: Fold open 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 one line up or down


Shift+Alt+Up, Shift+Alt+Down: Copy a line up and down


Ctrl+Shift+Enter: Insert above the current line One line


##Ctrl+Shift+F: Global search


##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 rollback


##Interface related

##Ctrl + \: Hide sidebar



Ctrl + m: Open or hide the emulator

##other


1. Modifying the wxml and wxss files will refresh the page


2. Modifying the js and json files will recompile the small Procedure


3. Modify the registration target page in the app.json file, and the page directory and files will be automatically generated


#4. When the development environment does not verify the requested secure domain name and the TLS version option is turned on, the applet will not verify the domain name security and other rules when running, which is more beneficial. For debugging during development, you can set


in Project - Basic Information. 5. You can quickly view the security of the current appid configuration in Project - Configuration Information. Domain name


6. When viewing the debugging applet on your mobile phone, you can click on the upper right corner and select enable debug to open the debugging mode

The above is the detailed content of Detailed explanation of WeChat mini program development skills and development tool usage skills. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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