tabbarStore.js 937 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { defineStore } from 'pinia'
  2. export const useTabbarStore = defineStore('tabbar', {
  3. state: () => ({
  4. list: [
  5. {
  6. iconPath: "home",
  7. selectedIconPath: "home-fill",
  8. text: '首页',
  9. count: 0,
  10. isDot: false,
  11. customIcon: false,
  12. pagePath: '/pages/index/index'
  13. },
  14. {
  15. iconPath: "chat",
  16. selectedIconPath: "chat-fill",
  17. text: '消息',
  18. count: 0,
  19. isDot: false,
  20. customIcon: false,
  21. pagePath: '/pages/chat/chat'
  22. },
  23. {
  24. iconPath: "account",
  25. selectedIconPath: "account-fill",
  26. text: '我的',
  27. count: 0,
  28. isDot: false,
  29. customIcon: false,
  30. pagePath: '/pages/personalCenter/personalCenter'
  31. },
  32. ],
  33. activeColor: "#0069f6",
  34. inactiveColor: '#606266'
  35. }),
  36. actions: {
  37. setMessageCount(count) {
  38. this.list[1].count = count
  39. },
  40. setActiveColor(color) {
  41. this.activeColor = color
  42. },
  43. setInactiveColor(color) {
  44. this.inactiveColor = color
  45. }
  46. }
  47. })