Skip to content

Commit

Permalink
fix: nav link highlight issue with i18n (close: #445)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed May 15, 2018
1 parent 45063ae commit 596014f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/default-theme/NavLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="nav-link"
:to="link"
v-if="!isExternal(link)"
:exact="link === '/'"
:exact="exact"
>{{ item.text }}</router-link>
<a
v-else
Expand All @@ -29,6 +29,12 @@ export default {
computed: {
link () {
return ensureExt(this.item.link)
},
exact () {
if (this.$site.locales) {
return Object.keys(this.$site.locales).some(rootLink => rootLink === this.link)
}
return this.link === '/'
}
},
methods: {
Expand Down

0 comments on commit 596014f

Please sign in to comment.