WeChat applet sets different top navigation bar names, WeChat applet navigation bar

Source: Internet
Author: User

The applet sets different top navigation bar names and the applet navigation bar
I. background

First, we know that there is a window attribute in app. json, which specifies the global display of the top navigation bar:

"Window": {"backgroundTextStyle": "light", "navigationBarBackgroundColor": "# fff", "navigationBarTitleText": "Haha", "navigationBarTextStyle": "black "},

But there is a problem here, that is, we have multiple pages. The top line of each page should be different. Therefore, it is incorrect to simply set app. json.

2. Set navigation text for different pages

In the applet documentation, we know that if you need to set special configurations for each page separately, you need to create a new one under the corresponding directory of each page. json file. When the program loads the file, it will automatically find the json file.

1. For example, the device directory indicates that the device creates a device. json file.

2. Note: only window-related configuration items can be set in. json of the page to determine the window performance of the page. Therefore, you do not need to write the window key, for example:

{"BackgroundTextStyle": "light", "navigationBarBackgroundColor": "# fff", "navigationBarTitleText": "device", "navigationBarTextStyle": "black "}

Here, we do not need to write the word window like app. json.
Result:

In this way, we can add different navigation topic names to each page, that is, the. json file of the new file.

Related Article

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.