1๐
โ
Add this.showComponent
to else
:
beforeCreate() {
this.showComponent= false;
s_auth.get(false, true).then(response => {
if (response.role.name === 'MANAGER') {
this.$router.push('/recipe-manager');
} else if (response.role.name === 'CLIENT') {
this.$router.push('/client');
} else if (response.role.name === 'JOE') {
this.$router.push('/joe');
} else { // add else here to change showComponent value when there is no route change
this.showComponent = true
}
})
}
๐คAlireza HI
Source:stackexchange.com