效果

配置
在app.json中加入tabBar配置节点:
"tabBar":{
"selectedColor":"#1296db",
"list":[{
"pagePath":"pages/index/index",
"text":"首页",
"iconPath":"images/home.png",
"selectedIconPath":"images/selected-home.png"
}, {
"pagePath":"pages/index/index",
"text":"分类",
"iconPath":"images/category.png",
"selectedIconPath":"images/selected-category.png"
}, {
"pagePath":"pages/index/index",
"text":"我的",
"iconPath":"images/my.png",
"selectedIconPath":"images/selected-my.png"
}]
},
注意:
- 小程序上给出的文档要求里面的item最少2个,最多五个;
-
跳转到带有tab的页面使用switchTab,不能跳转到不带tab的页面;
-
跳转不带tab的页面用redirectTo或者navigateTo;
- 图标可以到https://www.iconfont.cn/上面去淘淘。