So I have a component which executes code once it's mounted like this:
mounted(){
axios.get('/markers/' + this.username)
.then(response => {
this.markers = response.data.markers
}).catch((error) => console.log(error));
}
And I get the username like this:
username: this.$route.params.username
however, if I change the URL parameter, the username doesn't update so my AXIOS call doesn't update my markers. Why is this happening?
keyprop on the<router-view />component? i.E.<router-view :key="$route.fullPath" />? This might be needed for themountedhook to trigger when switching between view components.data()function look like, why not just call/markers/' + this.$route.params.usernameIs there any errors happening? This needs more information please./markers/john, and then you navigate to/markers/smith, it will still show john