[Vuejs]-VUE using axios- data received from server but not shown

0👍

When you mounted you have this:

mounted () {axios.get(url).then(response=>{
                console.log(response.data);
                this.res=response.data;
            });},

In your method you have:

greet: function (event) {
                    event.preventDefault();
                    axios.get(url).then(response=>{
                        console.log(response.data);
                        this.data=response.data;
                    });

Change this.data to this.res, because res is your array variable.

Leave a comment