12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // components/tabbar/tabbar.js
- const app = getApp()
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- currentIndex: {
- type: String,
- value: '0',
- }
- },
-
- /**
- * 组件的初始数据
- */
- data: {
- list: [
- {
- text: "首页",
- pagePath: "/pages/index/index",
- iconPath: "/images/tabbar/home-bar.png",
- selectedIconPath: "/images/tabbar/home-bar.png",
- },
- {
- text: "发布需求",
- pagePath: "/pages/releaseModule/index",
- iconPath: "/images/tabbar/release-bar.png",
- selectedIconPath: "/images/tabbar/release-bar.png",
- },
- {
- text: "消息",
- pagePath: "/pages/msgModule/index",
- iconPath: "/images/tabbar/msg-bar.png",
- selectedIconPath: "/images/tabbar/msg-bar.png",
- },
- {
- text: "我的",
- pagePath: "/pages/myModule/index",
- iconPath: "/images/tabbar/my-bar.png",
- selectedIconPath: "/images/tabbar/my-bar.png",
- },
- ]
- },
-
- /**
- * 组件的方法列表
- */
- methods: {
- tabChange(e) {
- console.log('tab change', e)
- const url = e.detail.item.pagePath;
- wx.redirectTo({ url });
- // wx.navigateTo({ url })
- }
- }
- })
|