0👍
Not sure on the logic behind it, but had to use .then() for my getVehicle response before it would work. So changed to:
getVehicle(to.params.id).then( response => {
next( vm =>
vm.setData(response)
);
});
0👍
I’m not sure it will work with a function inside the beforeRouteEnter guard. Instead try call the axios get method like
let data = axios.get('/api/v1/vehicles/${to.params.id})
next(vm.setData(err, data))
This should work
- [Vuejs]-Is there any way to fix CORS api calls from Laravel to a nodejs/expressjs client?
- [Vuejs]-Vscode not reloading typescript in vue files
Source:stackexchange.com