I’m using vue.js 3
with a select option using the oruga ui
. Why does my onSelect()
method only get the last values when it is selected? It’s like it is 1 selection behind, it’s showing the previous select, not the one selected at the time.
Select Option
<o-field>
<o-select
placeholder="Windows Licence"
expanded
size="is-medium"
v-model="selectedOptions.windowsLicence"
@input="onSelect()"
>
<optgroup>
<option v-for="(licence, index) in vdcSettings.windows" :key="index" :value="{ 'name':licence.name, 'price':licence.price, 'value':licence.value }">{{ licence.name }} - {{ $filters.currency(licence.price) }}</option>
</optgroup>
</o-select>
</o-field>
Data Object
data(){
return{
selectedOptions:{
windowsLicence:{
name:'None',
price:0,
value:'none'
},
},
windowsOption:{
price:0
}
}
Method: It’s getting the previous select, not the actual one
onSelect(){
console.log("Selected Windows Licence:", this.selectedOptions.windowsLicence);
},