Mi conocimiento de vue.js es limitado pero, por lo que sé, esto debería funcionar, por alguna razón, cuando intento acceder a mi variable en la propiedad de datos, no puedo encontrarla.

data: function() { return { id: 0, clients: [] } }, methods: { getClientData(){ fetch('/view-clients/' + this.id).then(function (response) { return response.text(); }).then(function (data) { this.clients = JSON.parse(data); this.id = this.clients[clients.length - 1].id; }).catch(function (error) { console.log('Error: ' + error); }); } }El alcance de la función es probablemente el culpable. En su lugar, use funciones de flecha para que this se refiera al componente Vue.
data() { return { id: 0, clients: [] } }, methods: { getClientData(){ fetch('/view-clients/' + this.id).then((response) => response.text()) .then((data) => { this.clients = JSON.parse(data); this.id = this.clients[this.clients.length - 1].id; }).catch((error) => { console.log('Error: ' + error); }); } }