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.6 KiB

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