Answer the question
In order to leave comments, you need to log in
How to view an array in Vue?
Good afternoon. Today I started learning vue. I don’t understand how you can see the array that I pulled out with a request?
<script>
import axios from 'axios';
export default {
name: 'taskListComponent',
data: () => ({
tasks: [],
errors: []
}),
created(){
axios.get('/api/tasks_list')
.then(response => {
this.tasks = response.data;
})
.catch(e => {
this.errors.push(e)
});
console.log(tasks);
},
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question