<span class="input-group-btn" style="min-width: 100px">
<select class="form-control" v-model="field.related_field">
<option value="null"></option>
<option v-for="f in fields" v-bind:value="f.id" v-if="f.id != ''" v-bind:selected="f.id == field.related_field ? true : false">{{ f.label }}</option>
</select>
</span>
I am developing a vue js app and the code snippet above is part of it. I am facing an issue where I am trying to automatically select an option if the user had submitted something previously when fetching data from the database. I have attempted to use the selected attribute to bind the selection but it's not working as expected. Any suggestions or solutions would be greatly appreciated. Thank you.