0👍
Here in the below code:
eventhub.$emit('post-added', response.body)
response.body
is undefined
. This is because body
isn’t a field exposed in the response for the request (This response schema is specific to the axios client.)1
Assuming that after making the HTTP POST request, the server returns a response that you’ll like to process in the client.
That response data can be retrieved in the data
field of the response in the following manner.
eventhub.$emit('post-added', response.data)
- [Vuejs]-[Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined"
- [Vuejs]-How i can to store a set of components for some separate vue apps?
Source:stackexchange.com