im new to vuejs and ive been struggling with trying to use the array of companies that has been assigned the response.data eventhough it has been used normally before.
export default{
name:"companies-list",
data(){
return{
companies: [],
currentCompany: null,
currentIndex: -1,
id:"",
search:'',
isEmpty:'true',
rows: []
};
},
retrieveCompanies(){
CompanyService.getAllCompanies()
.then(response =>{
this.companies = response.data;
console.log(response.data);
})
.catch(e=> {
console.log(e);
});
},
mounted(){
this.retrieveCompanies();
console.log(this.companies);
}
Here the console.log(this.companies) returns a proxy with an empty array. I'm trying to assign the contents of the companies that contain the companies from the retrieveCompanies() method to the empty rows[] array so that i can perform a filter on the rows according to the properties of the companies such as id and name. Thank you in advance.