Global configuration applet micro-channel
app.json file to the root directory of the small micro-channel applet for global configuration.
1. Add page
Add page in two ways:
The first method is, micro-channel path to the page configuration applet is configured in app.json applet file, a data file pages under app.json, which can add a page path, developer tools, micro-channel path according to an array of pages inside the page, automatically generating a corresponding file directory.
The second method is to be in the micro-channel developer tools, the next pages in the file structure of the project file in the folder, you can create a new directory, there will be a new directory, in the directory, the new needs of the page.
If you want the page which shows which pages can be placed in the path of the page in front of a small startup.
2.window: Global Configuration window
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#f66",
"navigationBarTitleText": "优购",
"backgroundColor": "#efefef",
"navigationBarTextStyle": "white",
"backgroundColorTop": "#0f0",
"onReachBottomDistance": 50
},
backgroundTextStyle: drop-down loading of style, only support Dark / Light
enablePullDownRefresh: whether to open the drop-down refresh the current page. The default value is false.
distance from the bottom of the page, the unit is bottoming px pull the trigger on the event page: onReachBottomDistance.
navigationBarBackgroundColor: Navigation bar background color. The default is hexadecimal.
navigationBarTextStyle: Navigation Bar title color, supports only black / white.
navigationBarTitleText: navigation bar title text.
The rest can reference micro-channel applet development documentation.
3.tabBar page layout
If the program is a small program more than one page, we can use the page jump tabBar components, click the appropriate option, you can jump to the corresponding page. tabBar, which has a list of list, it's an array, each object is inside a tab label, should have at least 2 tab.
{
"pagePath": "pages/home/home",
"text": "首页",
"iconPath": "icon/home.png",
"selectedIconPath": "icon/home_select.png"
},
{
"pagePath": "pages/kind/kind",
"text": "分类",
"iconPath": "icon/kind.png",
"selectedIconPath": "icon/kind_select.png"
},
{
"pagePath": "pages/cart/cart",
"text": "购物车",
"iconPath": "icon/cart.png",
"selectedIconPath": "icon/cart_select.png"
},
{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "icon/user.png",
"selectedIconPath": "icon/user_select.png"
}
pagePath: the need to jump path.
text: tabBar option, the text is displayed.
iconPath: tabBar option, the picture is not selected.
selectedIconPath: tabBar option, the picture is selected.
The advent of the epidemic, the war against the line!