K
K
Konstantin Malyarov2018-04-30 19:09:56
Vue.js
Konstantin Malyarov, 2018-04-30 19:09:56

VueJS how to select :selected in v-for loop?

There is a cycle in which all doctors are enumerated and the selected parameter is set, but why is there no display

<select v-model="disease_history.doctor" class="form-control col-2">
                <option v-for="user in users" :value="user.id" :selected="user.id === disease_history.doctor.id">{>user.last_name<} {>user.last_name[0]<}.
                    {>user.last_name[0]<}.
                </option>
            </select>

user.id === disease_history.doctor.idreturnstrue
5ae73fcfdf53e986353559.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
levchak0910, 2018-04-30
@Konstantin18ko

v-model="disease_history.doctor.id"
or
:value="user"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question