[Vuejs]-Vuejs api response result to many variables

2👍

set the variables on the last promise, so it will be like

fetchOffers() {
    this.$http.get('http://127.0.0.1:8000/api/offers')
        .then(response => response.json()) // this will return a Promise
        .then(result => { 
                    this.pagination = result.meta
                    this.links = result.links
                    this.offers = result.data
        })
},

Leave a comment