Skip to content

Commit

Permalink
Replace vue's buggy .router-link-exact-active
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lekha committed Sep 7, 2020
1 parent 5d95385 commit e10e6fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/css/base.scss
Expand Up @@ -146,7 +146,7 @@ h2 {
padding: 15px 30px;
}

.router-link-exact-active {
.router-link-active.exact {
background-color: $primary-light;
color: #000;
display: block;
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/layouts/Base.vue
Expand Up @@ -28,7 +28,14 @@
<div class="body">
<div class="sidebar">
<ul>
<li><router-link :to="{ name: 'Home' }">Questions</router-link></li>
<li>
<router-link
:to="{ name: 'Home' }"
:class="{ exact: $route.name === 'Home'}"
>
Questions
</router-link>
</li>
<li><a>Tags</a></li>
<li><a>Users</a></li>
</ul>
Expand Down

0 comments on commit e10e6fc

Please sign in to comment.