1. Global Configuration
The app.json
file in the root directory of the mini program is used to configure the global configuration of the mini program, deciding the path of the page file, the window performance, setting the network timeout, setting multiple tabs and so on.
The following is an app.json file that contains some common configuration options:
{
"pages": [
"pages/index/index",
"pages/logs/index"
],
"window": {
"navigationBarTitleText": "Demo"
},
"tabBar": {
"list": [{
"pagePath": "pages/index/index",
"text": "index"
}, {
"pagePath": "pages/logs/index",
"text": "log"
}]
},
"debug": true
}
2. Page Configuration
Each mini program page can also use the same name .json file to configure the window of the page, the configuration items in the page will override the same configuration items in the window of app.json.
For example:
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "title",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
}
Was this page helpful?