uni-app 的tabbar配置参数地址:json
https://uniapp.dcloud.io/collocation/pages?id=tabbarapp
tabBar的配置跟globalStyle同级字体
1.在pages新建几个页面spa
2.配置tabBar,code
color字体颜色对象
selectedColor选中的字体颜色blog
backgroundColor底部背景颜色get
borderStyle底部的border,只能是“black” 或者 "white"it
list , list是一个对象,包含如下这些选项io
pagePath: 页面路径
text :tab的文字
iconPath : 没选中的图标路径
selectedIconPath :选择后的图标路径。
例子:
page.json的tabBar配置
"tabBar":{ "color":"#333", "selectedColor":"deepskyblue", "backgroundColor":"#eee", "borderStyle":"black", "list":[ { "pagePath":"pages/index/index", "text":"首页", "iconPath":"./static/tabbar/index.png", "selectedIconPath":"static/tabbar/indexed.png" }, { "pagePath":"pages/news/news", "text":"动态", "iconPath":"static/tabbar/news.png", "selectedIconPath":"static/tabbar/newsed.png" }, { "pagePath":"pages/paper/paper", "text":"小纸条", "iconPath":"static/tabbar/paper.png", "selectedIconPath":"static/tabbar/papered.png" }, { "pagePath":"pages/my/my", "text":"个人", "iconPath":"static/tabbar/my.png", "selectedIconPath":"static/tabbar/myed.png" } ] }
3.图标制做方法:
(1)打开阿里巴巴图标库,登陆,找到对应的图标
(2)添加到项目,选择颜色和大小,颜色分别是选中时和未选中时的颜色,大小是80,选择png下载
4.效果: