0👍
You probably want to nest flats
inside floors
, and then filter the flats
based on the current floor
. It looks like each flat
has a floor
property which presumably matches an property in floor
. Assuming this is floor.id
, you can do something like:
<div v-for="(floor, floor_index) in Building.floors" :key="floor_index">
<pre>Floor: {{ floor }}</pre>
<div v-for="(flat, flat_index) in Building.flats" :key="flat_index">
<pre v=if="flat.floor === floor.id">Flat: {{ flat }}</pre>
</div>
</div>
- [Vuejs]-Why can't I scroll to the bottom of my div?
- [Vuejs]-Firebase Authentication Vue Router Guard Issue w/ Vuex
Source:stackexchange.com