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
ulivz committed May 15, 2018

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tonistiigi Tõnis Tiigi
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
@@ -3,7 +3,7 @@
class="nav-link"
:to="link"
v-if="!isExternal(link)"
:exact="link === '/'"
:exact="exact"
>{{ item.text }}</router-link>
<a
v-else
@@ -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: {

0 comments on commit 596014f

Please sign in to comment.