From 87bd79a6612f2e9eca1c4ad419a878fd36ba9d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Preu=C3=9F?= Date: Thu, 13 Apr 2023 21:44:43 +0200 Subject: [PATCH] Add exact link --- src/runtime/components/BitinflowFirstLevelHref.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/BitinflowFirstLevelHref.vue b/src/runtime/components/BitinflowFirstLevelHref.vue index b3ec6ad..1a235f5 100644 --- a/src/runtime/components/BitinflowFirstLevelHref.vue +++ b/src/runtime/components/BitinflowFirstLevelHref.vue @@ -22,12 +22,19 @@ export default { href: { type: String, default: '/' + }, + exact: { + type: Boolean, + default: false } }, computed: { calculateClasses: function () { 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 !== '/', } } }