0👍
So, you properly defined user in component data
. And the error you are getting might happen only in the case if res.data.user
is undefined which you are getting from API in getUsers
method.
I suggest, there is no user
object in response data. By that way res.data.user
is undefined
and as you reasigned this.user
to be equal res.data.user
it get undefined
value too.
0👍
Instead of “this.user = res.data.user” we have to wight “this.user = res.data”. And this solved this problem.
- [Vuejs]-Sending a HTTP POST REQUEST with image and text
- [Vuejs]-Vue js text field value becomes empty when new row is appended
Source:stackexchange.com