I would like to set the pagination result from response.data to Vue data.
The standard approach would be:
this.resultData = response.data.results
this.totalResults = response.data.total
this.perPageResults = response.data.per_page
However, I am curious if there is a more efficient ES6 method to directly assign the result to something like this:
const page = { results: data, total: total, per_page : perPage } = response.data
this = { ...this, ...page }
Please note that the code snippet above does not function correctly.