[Vuejs]-Cannot pass the fetch method information to the instance data

0👍

Change your mounted method. currenciess is an array while your results.results.currencies["USD"] is an object coming from API. I have created a playground for you here.

mounted() {
            console.log("mounted");
            fetch(url)
                .then(response => response.json())
                .then(results => {
                    this.currenciess.push(results.results.currencies["USD"]);
                });
        }

    Leave a comment