I want to get the name of the current route of vue-router, i have a component menu with navigation to another componentes, so i want to dispaly the name of the current route. I have this:
created(){
this.currentRoute;
//this.nombreRuta = this.$route.name;
},
computed:{
currentRoute:{
get(){
this.nombreRuta = this.$route.name;
}
}
}
But the label of the name of the route does not change, the label only show the name of the first loaded route. Thank You
EDIT:
Image to show what i want
this.$route.name
. - Husam IbrahimbeforeEach
hook in the routes file, see this: stackoverflow.com/questions/49685780/… - Dan Oswalt