1、在app.json文件找到“tarBar”对象,然后添加一个属性,代码如下:
"tabBar": {
"custom": true, //是否自定义
"color": "#000000",
"selectedColor": "#fec248",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"text": "首页"
},
{
"pagePath": "pages/catetory/index",
"text": "门禁"
},
{
"pagePath": "pages/my/index",
"text": "我的"
}
]
},
2、在pages文件夹同级目录下,新建一个文件夹,文件夹名称为 “custom-tab-bar” ,个人认为创建时生成component,
3、wxhl,wxss,js等 自己动手丰衣足食
想要我自己写,不可能,不可能,绝对不可能!
wxml代码
<view class="tab-bar-container">
<view class="tab-bar">
<view wx:for="{
{list}}" wx:key="index" class="tab-bar-item" data-path="
{
{item.page