Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Mini Program json request

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces "how to configure Mini Program json requests" in detail, with detailed contents, clear steps and proper handling of details. I hope this article "how to configure Mini Program json requests" can help you solve your doubts.

JSON configuration

We can see that there is an app.json and project.config.json in the root directory of the project, and there is also a logs.json in the pages/logs directory. Let's explain their purpose in turn.

Mini Program configures app.json

App.json is the current global configuration of Mini Program, including all page paths, interface performance, network timeout, bottom tab, etc., of Mini Program. The app.json configuration in the QuickStart project is as follows:

{

"pages": [

"pages/index/index"

"pages/logs/logs"

]

"window": {

"backgroundTextStyle": "light"

"navigationBarBackgroundColor": "# fff"

"navigationBarTitleText": "WeChat"

"navigationBarTextStyle": "black"

}

}

Let's briefly explain the meaning of each item of this configuration:

Pages field-used to describe all the current Mini Program page paths, this is to let Wechat clients know the directory in which your Mini Program pages are currently defined.

Window field-the background color at the top of all Mini Program pages. The text color is defined here.

For more information on other configuration items, please see the configuration app.json of Mini Program in the document.

Tool configuration project.config.json

Usually, when you use a tool, you will make some personalized configuration according to your preferences, such as interface color, compiler configuration, and so on. When you change to another computer to reinstall the tool, you have to reconfigure it.

With this in mind, the Mini Program developer tool will generate a project.config.json in the root directory of each project, and any configuration you make on the tool will be written to this file. When you reinstall the tool or change your computer, as long as you load the code package of the same project, the developer tool will automatically help you restore the personalized configuration of your project at that time. It includes a series of options such as the editor's color, automatic compression when the code is uploaded, and so on.

For details of other configuration items, please refer to the configuration of the documentation developer tool.

Page configuration page.json

The page.json here is actually used to indicate the configuration related to the Mini Program page, such as logs.json in the pages/logs directory.

If your entire Mini Program style is blue, then you can declare that the top color is blue in app.json. This may not be the case in reality, maybe each page in your Mini Program has a different hue to distinguish different functional modules, so we provide page.json, which allows developers to define some attributes of each page independently, such as the top color just mentioned, whether drop-down refresh is allowed, and so on.

After reading this, the article "how to configure Mini Program json request" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the article, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report