2nd Pit: Global profile App.json Common error Rollup

Source: Internet
Author: User

"I Am the Pit":The global profile App.json is prone to errors such as the following:

    • An error occurred in the file path.

    • The page is not configured on pages.

    • Code comments.

    • Use single quotation marks.


1. File path error
file path is incorrectly written, For example, the word is wrong or missing the directory name, this is more easily found. In addition, the filename does not need to write the file suffix, because the framework will automatically look for the path under. JSON,. js,. Wxml,. WXSS four files to consolidate.

3. Code comment
It's a good habit to write comments to code. But it's not good to write notes in the App.json file.

4. Using single quotation marks
The error is as follows:


This error, even if experienced by a veteran, may be tangled, the content configured in the App.json file is a JSON data format. In small programs, the JSON data format requirements are more stringent, you should use double quotes instead of single quotes!

"extended reading":

json syntax rules
in the JS language, everything is an object. Therefore, any supported type can be represented by JSON, such as strings, numbers, objects, arrays, and so on.

Here are some examples of how you would normally use single double quotes when defining JSON:

Finally, we recommend a JSON online parsing and formatting verification tool--json.cn.


2nd Pit: Global profile App.json Common error Rollup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.