底部导航栏的编写
一、准备工作
1,在项目文件夹里新建一个imges文件夹(与pages文件夹同级)用于存放图标
2,去阿里巴巴矢量库下载所需要的图标,保存到imges文件夹中
阿里巴巴矢量库地址:https://www.iconfont.cn/
二、代码编写
代码如下:
"tabBar": {
"selectedColor": "#C00000",
"borderStyle": "white",
"list": [
{
"selectedIconPath": "images/home2.png",
"iconPath": "images/home1.png",
"pagePath": "pages/home/home",
"text": "首页"
},
{
"selectedIconPath": "images/cate2.png",
"iconPath": "images/cate1.png",
"pagePath": "pages/cate/cate",
"text": "分类"
},
{
"selectedIconPath": "images/cart2.png",
"iconPath": "images/cart1.png",
"pagePath": "pages/cart/cart",
"text": "购物车"
},
{
"selectedIconPath": "images/my2.png",
"iconPath": "images/my1.png",
"pagePath": "pages/my/my",
"text": "个人中心"
}
]
},