Reputation: 193
I would like to get select's element id on v-on:change event on selected options in Vue.js
My vue code is :
<b-form-select id="1749614592" :
options="{'0': 'Default','1': 'Stored'}"
v-on:change="isOnChange($event)">
</b-form-select>
My script is :
methods: {
isOnChange: function(event) {
console.log(event.target.parentNode);
}
},
Upvotes: 0
Views: 700
Reputation: 1060
If I understand your question correctly you could try the following:
<b-form-select
id="1749614592" :
options="{'0': 'Default','1': 'Stored'}"
v-on:change="isOnChange($event, '1749614592')">
</b-form-select>
and as script:
methods: {
isOnChange: function(event, id) {
console.log("Selected id: " + id)
}
}
Upvotes: 2