Add exact link

This commit is contained in:
René Preuß
2023-04-13 21:44:43 +02:00
parent 378301d758
commit 87bd79a661

View File

@@ -22,12 +22,19 @@ export default {
href: { href: {
type: String, type: String,
default: '/' default: '/'
},
exact: {
type: Boolean,
default: false
} }
}, },
computed: { computed: {
calculateClasses: function () { calculateClasses: function () {
return { return {
'router-link-active': document.location.href.includes(this.href) && this.href !== '/', 'router-link-active':
this.exact
? document.location.href === this.href
: document.location.href.includes(this.href) && this.href !== '/',
} }
} }
} }