


Problems and solutions related to tabbar page display in mini program development
Yesterday during the development process of the WeChat applet, I encountered a situation where the tabbar was clearly defined, but it was never displayed. Searching on the Internet, I found that if there are students who have used tabbar during the development of WeChat applet, many of them also encountered the same problems. Why sometimes the tabbar has been added to app.json in the code, but it is not displayed on the page? Can some pages display tabbars and some pages not display tabbars? Today I will sort out the problems I encountered during the development process and share with you a small program development tutorial. Question 1: Why is the tabbar not displayed at the bottom of the page?Many netizens (including myself) have also encountered this kind of problem. I would like to remind everyone to think carefully and check whether the writing is correct! is written correctly as tabBar, do not write it as tabbar! If it is confirmed that the writing is correct, clearly adds tabbar in app.json, and also adds path in list, why is it not displayed? For example, in the following code, why does the tabbar not appear at the bottom of the screen as expected? } ] } } Let’s take a look at the page display results as follows:
"pages":[ "pages/clickDemo/clickDemo", "pages/logs/logs", "pages/index/index", "pages/mypage/mypage" The content of the list array in tabbar is:
"list": [ { "pagePath": "pages/index/index", "text": "Homepage", "iconPath": "image/location_normal.png", "selectedIconPath": "image/location_selected.png" }, { "pagePath": "pages/logs/logs", "text": "Settings", "iconPath": "image/setting_normal.png", "selectedIconPath": "image/setting_selecred.png" } Have you noticedWhy the TabBar does not appear at the bottom? The reason is that the first item "pages/clickDemo/clickDemo" in the pages array in the head of app.json has not become a member of tabBar, that is, there is no link click# in the list array of tabBar. ## Entries on the Demo page. ##{ "pagePath": "pages/clickDemo/clickDemo", "text": "EventDemo", "iconPath": "image/setting_normal.png", "selectedIconPath": "image/setting_selecred.png" } The effect is as follows: [Solution 2]. Set the first item of the pages array to "pages/index/index", Or set to "pages/logs/logs". Of course this method is not what we expected to see. After practice, we found that the first item (homepage) in the pages array in app.json must appear in the tabBar---list array. It doesn't matter which one is in the list; but if the homepage is not in the list, of course it cannot be rendered. This is It can be understood that app.json is configured for the first time. Display tabbar on non-home page?
Question 3: Some pages are not in the tabbar list page. Why is the tabbar also displayed at the bottom of the page? If you redirectTo from a first-level page to another page, you will find that TabBar will be displayed even if other pages are not in the list defined by TabBar. How to solve this problem? ##[Solution] If the current page is also a first-level page, go to the page you want to jump to When the page you are going to does not have a Tabbar, just use navigateTo instead of redirectTo.Question 4: Sometimes the wx.navigateTo event of the button button is added to the new page, but I don’t know why it cannot jump. Only by removing the tabBar can you jump to ?【Solution】 I believe many people have encountered this situation. After my own actual exploration, I found that if the page to be jumped belongs to the TabBar, wx.navigateTo will be invalid. If you want to switch, you need to use wx.switchTab. But one thing to note is that if you use wx.switchTab, there will be no return button. Of course, there is a navigator tag similar to the a tag in the mini program, which is used for jump processing.
|
The above is the detailed content of Problems and solutions related to tabbar page display in mini program development. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools
