So I am writing this Vue.JS code to display a data aquired by PHP from a server. The PHP returns a JSON object to the Vue and the VUE has to display it. My current code is:
axiosPost();
}
function axiosPost()
{
axios.post(
'./ConversationGetter.php',
{
function2call: 'getRecord',
id: 1,
access: this.accesstoken
}
)
.then(response => {this.data=response.data;
console.log(response.data);
console.log("Response From VUE JS"+this.data);
})
.catch(error => {});
}
The Problem is, First console.log
prints the Response data properly. But the second console.log
displays the this:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
If I use JSON.parse while displaying the data, it shows this:
undefined
"+" operator converting as string in second console statement. Please change it to "," as below?
console.log("Response From VUE JS", this.data);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With