Skip to content

Commit e10e6fc

Browse files
committed
Replace vue's buggy .router-link-exact-active
Details of the still-open issue are found here: vuejs/vue-router#2040 I used the exact hack recommended in there even though I hate how it looks. At least it's functioning correctly now.
1 parent 5d95385 commit e10e6fc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: frontend/src/css/base.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ h2 {
146146
padding: 15px 30px;
147147
}
148148

149-
.router-link-exact-active {
149+
.router-link-active.exact {
150150
background-color: $primary-light;
151151
color: #000;
152152
display: block;

Diff for: frontend/src/layouts/Base.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
<div class="body">
2929
<div class="sidebar">
3030
<ul>
31-
<li><router-link :to="{ name: 'Home' }">Questions</router-link></li>
31+
<li>
32+
<router-link
33+
:to="{ name: 'Home' }"
34+
:class="{ exact: $route.name === 'Home'}"
35+
>
36+
Questions
37+
</router-link>
38+
</li>
3239
<li><a>Tags</a></li>
3340
<li><a>Users</a></li>
3441
</ul>

0 commit comments

Comments
 (0)