Если все правильно поняли, то
async asyncData(ctx) {
let products = await ctx.app.$api.products(ctx.params.slug, ctx.query);
return {
products: products.data,
total: products.total,
perPage: products.per_page,
}
watch: {
'$route'() {
this.getProducts();
},
},
getProducts() {
this.$api.products(this.$route.params.slug, this.$route.query).then(products => {
this.products = products.data;
this.total = products.total;
this.perPage = products.per_page;
});
},
И при клике на пагинацию:
this.$router.push({
query: {
...this.$route.query,
page: page,
},
})