9***@qq.com
9***@qq.com
  • 发布:2019-05-03 12:39
  • 更新:2019-05-03 12:39
  • 阅读:3579

tabar的实现,从他们官网拿下来的,精简得很

分类:uni-app
tab

新建一个uni_app,把下面的代码复制到pages.json文件里去就可以用了

{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"borderStyle": "black",
"backgroundColor": "#333",
"color": "#8F8F94",
"selectedColor": "#f33e54",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/home.png",
"selectedIconPath": "static/img/tabbar/homeactive.png",
"text": "首页"
},
{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/guanzhu.png",
"selectedIconPath": "static/img/tabbar/guanzhuactive.png",
"text": "关注"
},
//#ifdef MP-WEIXIN
{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/add.png",
"selectedIconPath": "static/img/tabbar/addactive.png",
"text": "发布"
},
//#endif
//#ifndef MP-WEIXIN
{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/add.png",
"selectedIconPath": "static/img/tabbar/addactive.png"
},
//#endif
{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/news.png",
"selectedIconPath": "static/img/tabbar/newsactive.png",
"text": "消息"
},
{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/me.png",
"selectedIconPath": "static/img/tabbar/meactive.png",
"text": "我"
}
]
}
}

0 关注 分享

要回复文章请先登录注册