Explorar o código

feat: 实现多个地方展示消息时仍能正确置为已读

zhouyuhao hai 8 meses
pai
achega
62e3a87cf5

+ 3 - 3
src/components/NotificationMessageCard/src/NotificationMessageCard.vue

@@ -55,9 +55,9 @@ const curPageAllCards = ref<any>([])
 const watchCards = () => {
   curPageAllCards.value = document?.querySelectorAll('.notification-message-card')
   curPageAllCards.value.forEach((card: any) => {
-    const index = notificationMsgStore.notificationMsgList.indexOf(card.dataset.cardId)
-
-    if (index < 0 && card.dataset.cardIsread === 'false' && card.dataset.cardId) {
+    // const index = notificationMsgStore.notificationMsgList.indexOf(card.dataset.cardId)
+    // index < 0 &&
+    if (card.dataset.cardIsread === 'false' && card.dataset.cardId) {
       notificationMsgStore.concatNotificationMsgList([card.dataset.cardId])
 
       observer.observe(card)