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.
34 lines
676 B
34 lines
676 B
Component({
|
|
data: {
|
|
selected: 0,
|
|
color: "#999999",
|
|
selectedColor: "#ff3a3a",
|
|
list: [{
|
|
pagePath: "/pages/discover/index",
|
|
text: "发现音乐",
|
|
icon: "discover"
|
|
}, {
|
|
pagePath: "/pages/my-playlists/index",
|
|
text: "我的歌单",
|
|
icon: "playlist"
|
|
}, {
|
|
pagePath: "/pages/my-music/index",
|
|
text: "我的音乐",
|
|
icon: "music"
|
|
}]
|
|
},
|
|
methods: {
|
|
switchTab(e) {
|
|
const data = e.currentTarget.dataset
|
|
const url = data.path
|
|
wx.switchTab({
|
|
url,
|
|
success: () => {
|
|
this.setData({
|
|
selected: data.index
|
|
})
|
|
}
|
|
})
|
|
}
|
|
}
|
|
})
|