You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

Component({
data: {
selected: 0,//当前选中的tab下标
color: "#1E1E1E",
selectedColor: "#646464",//tabbar选中字体颜色
list: [{
"pagePath": "pages/index/index",
"iconPath": "/components/tabbarComponent/icons/home.png",
"selectedIconPath": "/components/tabbarComponent/icons/homeActive.png",
"text": "首页"
},
{
"pagePath": "pages/insight/index",
"iconPath": "/components/tabbarComponent/icons/insight.png",
"selectedIconPath": "/components/tabbarComponent/icons/insightActive.png",
"text": "洞察"
},
{
"pagePath": "pages/brandSearch/index",
"iconPath": "/components/tabbarComponent/icons/appSearch.png",
"selectedIconPath": "/components/tabbarComponent/icons/appSearchActive.png",
"text": "品牌搜索"
},
{
"pagePath": "pages/varComm/index",
"iconPath": "/components/tabbarComponent/icons/varComm.png",
"selectedIconPath": "/components/tabbarComponent/icons/varCommActive.png",
"text": "对比"
},
{
"pagePath": "pages/mine/index",
"iconPath": "/components/tabbarComponent/icons/mine.png",
"selectedIconPath": "/components/tabbarComponent/icons/mineActive.png",
"text": "我的"
}
],//tabbar循环数据集
},
attached() {
},
methods: {
switchTab(e) {
const data = e.currentTarget.dataset;
const url = data.path
this.setData({
selected: data.index
})
wx.switchTab({url})
}
},
})