menu : add active class on projects
This commit is contained in:
parent
5f5c53e284
commit
87484b4218
1 changed files with 16 additions and 4 deletions
|
|
@ -51,7 +51,10 @@
|
|||
<details v-if="currentProjects.length" open>
|
||||
<summary>Projets en cours</summary>
|
||||
<ul>
|
||||
<li v-for="project in currentProjects">
|
||||
<li
|
||||
v-for="project in currentProjects"
|
||||
:class="{ active: isCurrent(project) }"
|
||||
>
|
||||
<router-link :to="project.uri" class="new">{{
|
||||
project.title
|
||||
}}</router-link>
|
||||
|
|
@ -61,7 +64,10 @@
|
|||
<details v-if="archivedProjects.length">
|
||||
<summary>Projets archivés</summary>
|
||||
<ul>
|
||||
<li v-for="project in archivedProjects">
|
||||
<li
|
||||
v-for="project in archivedProjects"
|
||||
:class="{ active: isCurrent(project) }"
|
||||
>
|
||||
<router-link :to="project.uri" class="new">{{
|
||||
project.title
|
||||
}}</router-link>
|
||||
|
|
@ -123,7 +129,13 @@ function toggleExpand() {
|
|||
}
|
||||
|
||||
function isCurrent(navItem) {
|
||||
return navItem.path === route.path;
|
||||
console.log(navItem);
|
||||
if (navItem.path) {
|
||||
return navItem.path === route.path;
|
||||
}
|
||||
if (navItem.uri) {
|
||||
return navItem.uri === route.path;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -232,7 +244,7 @@ button[aria-controls="menu"][aria-expanded="false"] {
|
|||
}
|
||||
|
||||
#menu li.disabled {
|
||||
opacity: .5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
#menu li.disabled a::before {
|
||||
cursor: not-allowed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue