P
P
polzovatel_vue2019-12-04 19:38:58
Vue.js
polzovatel_vue, 2019-12-04 19:38:58

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>

I try to see console.log, but it gives an error

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Glebov, 2019-12-04
@polzovatel_vue

network tab
5mdvZz0T3DeWJA.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question