I'm new to Vue. While making this component I got stuck here.
I'm making an AJAX request to an API that returns an array using this code:
import axios from 'axios';
export default {
data() {
return {
tickets: [],
};
},
methods: {
getTickets() {
axios.get(url)
.then((response) => {
console.log(response.data) //[{}, {}, {}]
this.tickets = [...response.data]
console.log(this.tickets) //proxy object
})
},
},
created() {
this.getTickets();
}
};
The problem is, this.tickets
gets set to a Proxy
object instead of the Array
I'm getting from the API.
What am I doing wrong here?