[更新]新增动态tabBar
This commit is contained in:
43
custom-tab-bar/index.js
Normal file
43
custom-tab-bar/index.js
Normal 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
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user