- 单击底部的标签导航
- 切换“首页”和“我的”页面
- 修改app.json配置
- 添加pages/me/me
- 创建“我的”页面
添加tabBar配置,显示“首页”和“我的”标签
app.json最终的代码如下
{
"pages": [
"pages/index/index",
"pages/splash/splash",
"pages/item/item",
"pages/list/list",
"pages/search/search",
"pages/me/me"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#11998e",
"navigationBarTitleText": "豆瓣电影",
"navigationBarTextStyle": "#fff"
},
"tabBar": {
"selectedColor":"#11998e",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/icons/movie-1.png",
"selectedIconPath": "static/icons/movie-2.png"
},
{
"pagePath": "pages/me/me",
"text": "我的",
"iconPath": "static/icons/me-1.png",
"selectedIconPath": "static/icons/me-2.png"
}]
}
}