在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.首先建立 custom-tab-bar 文件夹 包含 index.js index.json index.wxml // index.js文件
index.json文件 {
"component": true,
"usingComponents": {
"van-tabbar": "@vant/weapp/tabbar/index",
"van-tabbar-item": "@vant/weapp/tabbar-item/index",
"van-icon": "@vant/weapp/icon/index"
}
}
index.wxml文件 <van-tabbar active="{{ active }}" bind:change="onChange">
<van-tabbar-item wx:for="{{ list }}" wx:key="index" icon="{{ item.icon }}">{{
item.text
}}</van-tabbar-item>
</van-tabbar>
/**
* 生命周期函数--监听页面显示 在每个tabbar页面onshow 调用即可;
*/
onShow: function () {
console.log('个人中心')
this.getTabBar().init();
},
app.json文件 {
"pages": [
"pages/index/index",
"pages/index/prize",
"pages/index/exchange",
"pages/index/my"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"usingComponents": {
},
"tabBar": {
"custom": true,
"color": "#000000",
"selectedColor": "#000000",
"backgroundColor": "#000000",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页"
},
{
"pagePath": "pages/index/prize",
"text": "奖品"
},
{
"pagePath": "pages/index/exchange",
"text": "兑换"
},
{
"pagePath": "pages/index/my",
"text": "我的"
}
]
},
"sitemapLocation": "sitemap.json"
}
原创未经允许不得转载!!!转载请注明出处~谢谢合作; |
请发表评论