微信小程序中的【tabBar】-建立底部导航菜单

app.json文件用来对微信小程序进行全局配置,决定页面文件的路径、窗口表现、设置网络超时时间、设置多 tab 等。

解释一下 对应的属性信息

tabBar  指底部的 导航配置属性

color  未选择时 底部导航文字的颜色

selectedColor  选择时 底部导航文字的颜色

borderStyle  底部导航边框的样色(注意 这里如果没有写入样式 会导致 导航框上边框会出现默认的浅灰色线条

list   导航配置数组

selectedIconPath 选中时 图标路径

iconPath 未选择时 图标路径

pagePath 页面访问地址

text  导航图标下方文字


如果要改变更详细的样式 请参看

https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html#tabBar


"tabBar": {
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"selectedIconPath": "pages/images/icon_seo_HL.png",
"iconPath": "pages/images/icon_seo.png"
},
{
"pagePath": "pages/logs/logs",
"text": "日志"
},
{
"pagePath": "pages/logs/logs",
"text": "我的设置",
"selectedIconPath": "pages/images/icon_speed_HL.png",
"iconPath": "pages/images/icon_speed.png"
}
],
"color": "#8B4513",
"selectedColor": "#FF6347"
}


猜你喜欢

转载自blog.csdn.net/dxnn520/article/details/79081746