I know that the v-model data should be the same as the default option but what I do when I have things setup like this:
data: function() {
return {
user: {
usertype: {},
}
}
<select v-model="user.usertype" class="btn btn-secondary d-flex header-input">
<option
v-for="(usertype, index) in usertypes"
:key="index"
:value="{value: usertype['short_desc_'+locale], max_user: usertype['max_user']}"
>{{usertype['short_desc_'+locale]}}</option>
I tried adding another option disabled value="" but it didn't select it as default. more like, it doesn't show. when I open up the dropdown menu, the first item is checked already but it does not show when its closed. any help is appreciated :)
Edit: Structure of usertypes
[{"id":1,"short_desc_de":"Mann","short_desc_en":"Men","min_user":1,"max_user":1,"created_at":"2019-09-19 08:07:06","updated_at":"2019-09-19 08:07:06"},{"id":2,"short_desc_de":"Frau","short_desc_en":"Woman","min_user":1,"max_user":1,"created_at":"2019-09-19 08:07:06","updated_at":"2019-09-19 08:07:06"},...]
usertypesas well?user.usertypeis unset? It's not very clear from the question.