Skip to content

Commit f42cb9f

Browse files
committed
fix for navbar tracking current route
1 parent 9f8bd4b commit f42cb9f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

frontend/src/components/shared/NavBar.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,24 @@ export default {
4949
data() {
5050
return {
5151
isOpen: false,
52+
route: null,
5253
};
5354
},
55+
watch: {
56+
$route(to) {
57+
this.route = to.name;
58+
},
59+
},
5460
computed: {
5561
loggedIn() {
5662
return this.$store.getters.getLoggedInUser;
5763
},
5864
currentRoute() {
59-
return this.$router.currentRoute.name;
65+
return this.route;
6066
},
6167
},
68+
beforeMount() {
69+
this.route = this.$router.currentRoute.name;
70+
},
6271
};
6372
</script>

0 commit comments

Comments
 (0)