[更新]新增动态tabBar

This commit is contained in:
唐明明
2020-12-28 15:27:42 +08:00
parent 092f0bad14
commit 5f2a66b04f
15 changed files with 160 additions and 1 deletions

43
custom-tab-bar/index.js Normal file
View File

@@ -0,0 +1,43 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
Component({
/**
* 组件的初始数据
*/
data: {
selected : getApp().globalData.storeModule.selected,
color : getApp().globalData.storeModule.color,
selectedColor: getApp().globalData.storeModule.selectedColor,
list : getApp().globalData.storeModule.list
},
/**
* 生命周期函数
*/
pageLifetimes: {
show(){
console.log("获取配置信息")
}
},
/**
* 组件的方法列表
*/
methods: {
switchTab(e) {
const data = e.currentTarget.dataset
const url = data.path
wx.switchTab({
url
})
this.setData({
selected: data.index
})
}
}
})