Solve the problem that the uniapp configuration base tarbar does not display

1. Ensure that the path of the list in the tarbar is in "pages"

2. The first path of "list" in tarbar is the same as the first path of "pages", and the one copied directly is the same

3. The reference position of the picture is correct

4. Upper and lower case! ! !

        For example my error:

 

There is no problem with compiling, but a configuration problem will be prompted when packaging.

 is actually prompting me that "pagePath" is missing. I wrote "pagepath". That is to say, you need to use camel case naming, and the second p should be capitalized.

After modification, it still does not display, similarly,

"iconpath" also needs to be changed to "iconPath"

If "selectediconpath" is not changed, it will not affect the tarbar display, but the lowercase has no effect, and the iconpath will still be displayed when selected, so it must be changed to "selectedIconPath"

Correct spelling:

"tabBar": {
		"selectedColor": "#b50e03",
		"color": "#ccc",
		"list": [{
				"text": "首页",
				"pagePath": "pages/index/index",
				"iconPath": "static/tarbar/index.png",
				"selectedIconPath": "static/tarbar/indexclick.png"
			},
			{
				"text": "商品",
				"pagePath": "pages/shops/shops",
				"iconPath": "static/tarbar/shops.png",
				"selectedIconPath": "static/tarbar/shopsclick.png"
			}

		]
	}

success:

 

Guess you like

Origin blog.csdn.net/weixin_45752941/article/details/128229936