Here is a snippet of my axios request code:
.then(function (response) {
self.forms.process = false;
if( response.data.redirect ){
console.log(123);
router.push({ name: response.data.redirect });
}
})
.catch(function (error) {
console.log(error.response.data);
When I remove router.push, there are no errors. However, when I use router.go instead, an error occurs at the console.log(error.response.data) line:
- // 123 is printed by console.log before router.push here
- Uncaught (in promise) TypeError: Cannot read property 'data' of undefined
I am struggling to figure out how to fix this bug.