methods: {
signIn(){
axios({
method: 'post',
url: 'http://localhost:9000/auth/login',
data: this.login,
}).then(function (response) {
console.log(response.data.token);
this.$router.push('/'); // it is not available here in framework7vue.. what would be alternative for it
});
}
}
this inside axios is not pointing to vue instance. declare a vm before the axios call and then use it.
eg
let vm = this // now VM is your vue instance
axios({
method: 'post',
url: 'http://localhost:9000/auth/login',
data: this.login,
}).then(function (response) {
console.log(response.data.token);
vm .$router.push('/'); // it is not available here in framework7vue.. what would be alternative for it
});
}
}
Thank you so much for you response
Alternative would be:
this.$f7router.navigate('/');