Wechat small program development skills (continue to update ing)

Component part


  1. is a wrapper element only, subject to attribute control and cannot be nested and will not be rendered


  2. components can only be nested within a

    component

  3. Only content in the

    component supports long-press selection

  4. The range array subscripts in the component must be consecutive and start at 0, otherwise the option will be null

  5. Component names are all lowercase, and all uppercase component names are converted to lowercase at rendering time

  6. Any custom component < custom name > will be rendered as a

    component, but be careful not to have a number in the component name. (Although semantic components can be customized, they are not recommended because wechat official did not explain them.)

  7. Using the Page tag selector, you can modify the style of the top-level node, which is equivalent to the element in HTML

Tool parts

  1. Modifying the WXML and WXSS files will refresh the page

  2. Modifying the JS and JSON files will recompile the applet

  3. Adding the target page to the app.json file Pages array will automatically generate the page directory and required files

  4. Item – Basic Information If the development environment does not verify the request security domain name and TLS version, the HTTP request address can be used to facilitate local debugging

  5. You can quickly view the security domain name configured for the current APPID in item – Configuration

  6. During mobile phone debugging, you can tap in the upper right corner and select Enable Debug to enable mobile phone debugging

  7. Project – Preview can add preview page and parameter information, skip tedious foreplay to the location you want to operate

  8. shortcuts

    formatting

    Ctrl+S: Save file Ctrl+[, Ctrl+] : Indent code line Ctrl+Shift+[, Ctrl+Shift+] : Collapse 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 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 Ctrl+Shift+F: global searchCopy the code

    The cursor associated

    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 Shift+Home: Select from the beginning of the line to the cursor Ctrl+Shift+L: Select all matches Ctrl+D: Select match Ctrl+U: cursor rollbackCopy the code

    Interface related

    Ctrl + m: Open or hide the emulatorCopy the code