Browse Source

导航栏-通知:样式调整

Xiao_123 4 weeks ago
parent
commit
620cb53f82
2 changed files with 21 additions and 18 deletions
  1. 20 17
      src/layout/message.vue
  2. 1 1
      src/layout/personal/navBar.vue

+ 20 - 17
src/layout/message.vue

@@ -1,15 +1,16 @@
 <template>
 <template>
-  <!-- <v-badge
+  <v-badge
     color="error"
     color="error"
-    :content="IM.unreadCount"
+    :content="IM.unreadCount > 99 ? '99+' : 85"
     :model-value="IM.unreadCount > 0"
     :model-value="IM.unreadCount > 0"
-    offset-y="10"
-  > -->
-     <div class="customIcon" @click="router.push(path)">
-      <v-icon class="mr-1" color="primary" size="16">mdi-bell</v-icon>
-      <span v-if="IM.unreadCount > 0">{{ IM.unreadCount > 99 ? '99+' : IM.unreadCount }}</span>
-     </div>
-  <!-- </v-badge> -->
+    offset-y="1"
+    offset-x="4"
+  >
+    <div class="customIcon" :class="{'noUnReadWidth': IM.unreadCount <= 0}" @click="router.push(path)">
+      <v-icon color="primary" size="16">mdi-bell</v-icon>
+    </div>
+
+  </v-badge>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
@@ -34,17 +35,10 @@ useIM()
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-// :deep(.v-btn__content) {
-//   font-size: 15px;
-// }
-// @media (max-width: 1425px) {
-//   :deep(.v-btn__content) {
-//     font-size: 13px;
-//   }
-// }
 .customIcon {
 .customIcon {
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
+  justify-content: center;
   height: 26px;
   height: 26px;
   line-height: 23px;
   line-height: 23px;
   color: #00B760;
   color: #00B760;
@@ -58,4 +52,13 @@ useIM()
     background-color: #d7f3e7;
     background-color: #d7f3e7;
   }
   }
 }
 }
+.noUnReadWidth {
+  width: 26px;
+}
+:deep(.v-badge__badge) {
+  width: 17px;
+  height: 17px;
+  min-width: 17px;
+  font-size: 10px;
+}
 </style>
 </style>

+ 1 - 1
src/layout/personal/navBar.vue

@@ -17,7 +17,7 @@
             <template v-else>
             <template v-else>
               <span 
               <span 
                 class="cursor-pointer menuList-first-title"
                 class="cursor-pointer menuList-first-title"
-                @click.stop="handleClick(val, true)">
+                @click.stop="handleClick(val, val.title === '首页' ? false : true)">
                 {{ val.title }}
                 {{ val.title }}
               </span>
               </span>
             </template>
             </template>