computed: {
stationsWithCars() {
return this.cars.reduce(
(acc, n) => (acc[n.address]?.cars.push(n), acc),
Object.fromEntries(this.stations.map(n => [ n.name, { station: n, cars: [] } ]))
);
},
},
<div v-for="{ station, cars } in stationsWithCars" :key="station.id">
<h1>{{ station.name }}</h1>
<ul>
<li v-for="car in cars" :key="car.id">{{ car.name }}</li>
</ul>
</div>