I have a dropdown that gets populated from an array in my Vue model, like so:
<!-- First dropdown -->
<select v-model="building">
<option v-for="building in buildings" v-bind:value="building.id">
{{ building.name }}
</option>
</select>
<!-- Entries Input -->
<input v-model="entries" type="number">
After the user selects this dropdown and clicks a button, a bunch of other dropdowns will be created (the amount depends on the number the user typed in another input field):
<!-- Dynamically created dropdowns -->
<div v-for="entry in entries">
<select>
<option v-for="building in buildings" :selected="building.id == building">
{{ building.name }}
</option>
</select>
</div>
I need the dynamically created dropdowns to have the same selection as the first dropdown. I can't bind them via v-model because I need each of them to be able to be changed without affecting the other ones.
Any idea how to do this? I thought my code :selected="building.id == building" would work but it does not seem to.
buildingfor a data item and also for a v-for alias.