vue routes
-
hey everyone , I’m facing a small problem with routes in the below code
if(this.$router.currentRoute.path == ‘/become-sayes’){
this.$router.push(’/’)
console.log(‘in header’,this.$router.currentRoute.path);
}I check if i’m in certain route then I change it but when I print the currentRoute it still print the previous route ‘/become-sayes’ although when I print this.$route only I can see that it actually changed.
Is there any reason why this happens?