uniapp 登录页面跳转到tabbar页面
时间: 2023-08-03 17:05:48 浏览: 219
要实现从登录页面跳转到tabbar页面,可以使用uni-app提供的路由跳转功能。具体步骤如下:
1. 在登录成功后,使用uni.navigateTo方法跳转到tabbar页面。例如:
```
uni.navigateTo({
url: '/pages/tabbar/tabbar'
})
```
2. 在tabbar页面中,需要在页面配置文件(如pages.json)中设置tabBar属性,指定底部菜单栏的样式和功能。例如:
```
{
"tabBar": {
"color": "#999",
"selectedColor": "#007aff",
"backgroundColor": "#f7f7f7",
"borderStyle": "black",
"list": [
{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/static/tabbar/home.png",
"selectedIconPath": "/static/tabbar/home_active.png"
},
{
"pagePath": "/pages/mine/mine",
"text": "我的",
"iconPath": "/static/tabbar/mine.png",
"selectedIconPath": "/static/tabbar/mine_active.png"
}
]
}
}
```
注意:tabBar属性中的list数组中的每一项都需要指定pagePath属性,对应的值为tabbar页面中的子页面路径。
希望能够帮到你!
阅读全文
相关推荐


















