0👍
Just create a new computed property to transform your data and use it instead, maybe something like this:
data() {
jsonData: [ /* ... */ ]
},
created() { /* ... */ },
computed: {
transformedData() {
return this.jsonData.reduce((acc, curr) => {
const parcelId = curr.parcel_id;
if (Array.isArray(acc.parcelId)) {
acc[parcelId].push(curr);
} else {
acc[parcelId] = [curr];
}
return acc;
}, {});
}
}
Source:stackexchange.com