message.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <!-- <v-badge
  3. color="error"
  4. :content="IM.unreadCount"
  5. :model-value="IM.unreadCount > 0"
  6. offset-y="10"
  7. > -->
  8. <div class="customIcon" @click="router.push(path)">
  9. <v-icon class="mr-1" color="primary" size="16">mdi-bell</v-icon>
  10. <span v-if="IM.unreadCount > 0">{{ IM.unreadCount > 99 ? '99+' : IM.unreadCount }}</span>
  11. </div>
  12. <!-- </v-badge> -->
  13. </template>
  14. <script setup>
  15. defineOptions({ name: 'layout-message' })
  16. import { useIM } from '@/hooks/web/useIM'
  17. import { useIMStore } from '@/store/im'
  18. import { useRouter } from 'vue-router'
  19. defineProps({
  20. path: {
  21. type: String,
  22. default: '/recruit/personal/message'
  23. }
  24. })
  25. const router = useRouter()
  26. const IM = useIMStore()
  27. // useDataSource()
  28. // const { resetConfig } = useIM()
  29. useIM()
  30. </script>
  31. <style lang="scss" scoped>
  32. // :deep(.v-btn__content) {
  33. // font-size: 15px;
  34. // }
  35. // @media (max-width: 1425px) {
  36. // :deep(.v-btn__content) {
  37. // font-size: 13px;
  38. // }
  39. // }
  40. .customIcon {
  41. display: flex;
  42. align-items: center;
  43. height: 26px;
  44. line-height: 23px;
  45. color: #00B760;
  46. padding: 0 10px;
  47. background-color: #e0f6ec;
  48. border-radius: 4px;
  49. font-weight: bold;
  50. font-size: 12px;
  51. cursor: pointer;
  52. &:hover {
  53. background-color: #d7f3e7;
  54. }
  55. }
  56. </style>