Skip to content
Snippets Groups Projects
Commit d78778da authored by Anders Høvik's avatar Anders Høvik
Browse files

Added dynamic counter to notification button

parent f28da886
Branches ResetPassword
No related tags found
1 merge request!59Feature/inbox
Pipeline #281743 failed
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<a data-mdb-dropdown-init class=" nav-link me-3 dropdown-toggle hidden-arrow notification" href="#" id="navbarDropdownMenuLink" <a data-mdb-dropdown-init class=" nav-link me-3 dropdown-toggle hidden-arrow notification" href="#" id="navbarDropdownMenuLink"
role="button" data-bs-toggle="dropdown" aria-expanded="false"> role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fas fa-bell text-white"></i> <i class="fas fa-bell text-white"></i>
<span class="badge rounded-pill badge-notification bg-danger">1</span> <span class="badge rounded-pill badge-notification bg-danger">{{counter}}</span>
</a> </a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li v-for="(array,key) in notifMap" :key="key" > <li v-for="(array,key) in notifMap" :key="key" >
...@@ -116,6 +116,8 @@ let notifId = ref(0); ...@@ -116,6 +116,8 @@ let notifId = ref(0);
let path = ref('#'); let path = ref('#');
let counter = ref(0)
/* id: 0 -> /roadmap /* id: 0 -> /roadmap
id: 1 -> /profile id: 1 -> /profile
...@@ -135,6 +137,8 @@ function getNotification(){ ...@@ -135,6 +137,8 @@ function getNotification(){
notifId.value++ notifId.value++
notifMap.value.set(notifId.value,response3.value) notifMap.value.set(notifId.value,response3.value)
notifId.value++ notifId.value++
counter.value = notifMap.value.size
} }
function toBadges(){ function toBadges(){
...@@ -154,6 +158,10 @@ function getPath(id : string){ ...@@ -154,6 +158,10 @@ function getPath(id : string){
return '#'; return '#';
} }
function updateNotification(){
//Axios get request to the getFunction
}
function removeNotification() { function removeNotification() {
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment