一、例子(代码)
在app.json文件中
"tabBar": {
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "pages/index/images/首页.png",
"selectedIconPath": "pages/index/images/首页.png"
},
{
"pagePath": "pages/user",
"text": "我的",
"iconPath": "pages/index/images/我的.png",
"selectedIconPath": "pages/index/images/我的.png"
},
{
"pagePath": "pages/message",
"text": "信息",
"iconPath": "pages/index/images/message.png",
"selectedIconPath": "pages/index/images/message.png"
}
]
}
分析:
tabBar是导航栏,默认在底部,List是它的一个属性,同时,它自己也有四个属性,如上。
- pagePath是页面路径,后面对应你要跳转到的页面(必填)
- text是文本信息,后面对应你的提示信息,一般与所跳转的页面对应(必填)
- iconPath是图像地址,后面对应的你导航栏所对应的图标地址(选填)
- selectedIconPath是点击导航栏后你的图像地址,后面对应相应的地址(选填)
二、效果
想要了解更多请点击进入官网
(参考资料微信开发者文档)