vuejs select dropdown selected code example
Example 1: drop down v-for vuehs
<select v-model="testVal">
<option v-for="item in test" :value="item">{{item}}</option>
</select>
and in data
data() {
return{
test: ['one', 'two', 'three'],
testVal: null
}
}
Example 2: how to select specific option in vue
<select>
<option v-for="(item , index) in categories" v-bind:key="index" :selected= "item.id == 30" >
{{item.title}}
</option>
</select>