Need help with extracting item properties when clicking on the option button
Below is the code snippet:
<select @click="populate" class="form-control" tabindex="12">
<option disabled value="" selected="selected">Select one</option>
<option v-for="(payment, index) in paymentsSelect" @click="pop(payment)"
:key="index"
:value="payment.id">{{ payment.name }}
</option>
</select>
Data:
selectedPayment: '',
paymentsSelect: [],
Methods:
pop(payment){
console.log(payment)
},
populate(){
var self = this
this.$http.get(this.$backendUrl + 'subjects/payment_method')
.then(function(response) {
self.paymentsSelect = response.data.data
})
.catch(function() {})
}