Files
AGuestSaas/custom-tab-bar/index.js
2020-12-28 17:13:09 +08:00

50 lines
1.0 KiB
JavaScript

/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
import { mall, video, ticket, user} from "../lib/tabBarData"
Component({
/**
* 组件的初始数据
*/
data: {
selected : 0,
color : "#4e4f51",
selectedColor: "#0b0041",
list : [video, mall, ticket, user]
},
/**
* 生命周期函数
*/
lifetimes:{
// attached: ()=>{
// //获取模版信息
// wx.$api.publics.storeConfig({
// company_id: "17"
// }).then(res=>{
// console.log(res)
// })
// }
},
/**
* 组件的方法列表
*/
methods: {
switchTab(e) {
const data = e.currentTarget.dataset
const url = data.path
wx.switchTab({
url
})
this.setData({
selected: data.index
})
}
}
})