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.
45 lines
1.0 KiB
45 lines
1.0 KiB
Component({
|
|
data: {
|
|
selected: 0,
|
|
color: "#7A7E83",
|
|
selectedColor: "#3cc51f",
|
|
"list": [
|
|
{
|
|
"pagePath": "/pages/index/index",
|
|
"text": "首页",
|
|
"iconPath": "/images/home.png",
|
|
"selectedIconPath": "/images/home-active.png"
|
|
},
|
|
{
|
|
"pagePath": "/pages/fourm/fourm",
|
|
"text": "论坛",
|
|
"iconPath": "/images/message.png",
|
|
"selectedIconPath": "/images/message-active.png"
|
|
},
|
|
{"pagePath": "/pages/cart/cart",
|
|
"text": "购物车",
|
|
"iconPath": "/images/message.png",
|
|
"selectedIconPath": "/images/message-active.png"
|
|
},
|
|
{
|
|
"pagePath": "/pages/usercenter/usercenter",
|
|
"text": "我的",
|
|
"iconPath": "/images/message.png",
|
|
"selectedIconPath": "/images/message-active.png"
|
|
}
|
|
|
|
]
|
|
},
|
|
attached() {
|
|
},
|
|
methods: {
|
|
switchTab(e) {
|
|
const data = e.currentTarget.dataset
|
|
const url = data.path
|
|
wx.switchTab({url})
|
|
this.setData({
|
|
selected: data.index
|
|
})
|
|
}
|
|
}
|
|
}) |