#34 - add menu notifications count
This commit is contained in:
parent
451e82f492
commit
bc64db15f9
1 changed files with 8 additions and 0 deletions
|
|
@ -38,6 +38,9 @@
|
|||
:data-icon="mainItem.icon"
|
||||
:key="mainItem.path"
|
||||
:class="{ active: isCurrent(mainItem), disabled: mainItem.disabled }"
|
||||
:data-count="
|
||||
mainItem.title === 'Notifications' ? notificationCount() : undefined
|
||||
"
|
||||
>
|
||||
<router-link
|
||||
:to="mainItem.path"
|
||||
|
|
@ -155,6 +158,11 @@ function collapse() {
|
|||
isExpanded.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function notificationCount() {
|
||||
return user.value.notifications.map((notification) => notification.isRead)
|
||||
.length;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue