[Vuejs]-Setting selected attribute of an option based on property of outer v-for

1👍

You need to add a colon(:) before selected. In VueJS, if u write an expression to set the value of an HTML attribute, u should use v-bind:<propName> or just :propName.

You already did it for v-bind:value, you just missed it for selected.

<option v-for="tm in AvailableTeams" v-bind:value="tm.id" :selected="{{tm.id === week.team_id}}">
  {{ tm.name }}
</option>

Leave a comment