Within a v-for loop, I am utilizing a select form in the following manner:
<div class="select">
<select v-model="shippingMethod">
<option value="{{shipping.id}}" v-for="shipping in shippingMethods" data-price="{{ shipping.amount}}">{{shipping.description}} - {{shipping.amount / 100}}</option>
</select>
<div class="select__arrow"></div>
</div>
I have a method that watches the changes in the shippingMethod
model like so:
updateTotal: function(event){
console.log(this.shippingMethod);
},
While I can retrieve the newly selected option's value, I also need to access the data-price attribute. How would I go about achieving this?