Answer the question
In order to leave comments, you need to log in
How to get the selected option from a SELECT in a component in VUE.JS?
There is a component
in the select component with a list,
<Enums v-model="orgs"></Enums>
<select :value="value">
<option value="1">Организация 1</option>
<option value="2">Организация 2</option>
</select>
Answer the question
In order to leave comments, you need to log in
When changing the value of the select, you must send the new value to the parent.
Add a select @input="$emit('input', $event.target.value)"
, or make it a computed property:
innerValue: {
get() {
return this.value;
},
set(val) {
this.$emit('input', val);
},
},
<select v-model="innerValue">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question