tabbarStore.js 967 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. backgroundColor: '#f7f7f7'
  36. }),
  37. actions: {
  38. setMessageCount(count) {
  39. this.list[1].count = count
  40. },
  41. setActiveColor(color) {
  42. this.activeColor = color
  43. },
  44. setInactiveColor(color) {
  45. this.inactiveColor = color
  46. }
  47. }
  48. })