I get a json data from the api and when i render the data only inside the then function i get the normal JSON when it comes out of the scope it again become promise.
getproducts: function () {
var xx ={};
var apidata = Vue.axios.post('http://127.0.0.1:5000/').then((response) => {
return response.data
}).then(function(result) {
// console.log(result.products) //will log results.
console.log(result.products);
return result.products;
})
console.log(apidata)
return apidata
}`
the result.products gives normal json data but when i return the apidata it became promise.