#34 - add menu notifications count

This commit is contained in:
isUnknown 2024-12-17 14:08:31 +01:00
parent 451e82f492
commit bc64db15f9

View file

@ -38,6 +38,9 @@
:data-icon="mainItem.icon" :data-icon="mainItem.icon"
:key="mainItem.path" :key="mainItem.path"
:class="{ active: isCurrent(mainItem), disabled: mainItem.disabled }" :class="{ active: isCurrent(mainItem), disabled: mainItem.disabled }"
:data-count="
mainItem.title === 'Notifications' ? notificationCount() : undefined
"
> >
<router-link <router-link
:to="mainItem.path" :to="mainItem.path"
@ -155,6 +158,11 @@ function collapse() {
isExpanded.value = false; isExpanded.value = false;
} }
} }
function notificationCount() {
return user.value.notifications.map((notification) => notification.isRead)
.length;
}
</script> </script>
<style> <style>