render router-link in menu only if current route was matched by router, comment out fallback route

This commit is contained in:
Harald Bamberger
2026-07-06 10:52:53 +02:00
parent d1adc160ca
commit a06d7bbfec
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -9,6 +9,10 @@ export default {
}
},
methods: {
isRouterHandled() {
let isrouterhandled = this.$route.matched.length > 0;
return isrouterhandled;
},
isCompatLink() {
if(this.href === null) {
return false;
@@ -20,7 +24,7 @@ export default {
}
},
template: `
<router-link v-if="this.isCompatLink()"
<router-link v-if="this.isRouterHandled() && this.isCompatLink()"
:to="this.calcCompatRouterLink()"
>
<slot></slot>