I have one auth component that I am using both in the login and the signup route.
const routes = [{
path : \'/\',
name: \'home\',
component: Home
}
vuejs caches rendered component. you don't provide Auth
component code, but i think the following helps you.
export default {
name: 'Auth',
//component code .....
data: function() {
return {
usernameinput: '',
//and other stuff
}
},
watch: {
// call method if the route changes
'$route': 'reInitialize'
},
methods: {
reInitialize: function() {
this.usernameinput = '';
//and so on
}
},
//remainig component code
}
also there is another posibilty, may be you are using dynamic components and keep-alive
is true.