Answer the question
In order to leave comments, you need to log in
Is it possible to set a default option in vue if the model value does not match any option value?
Is it possible to set a default option in vue if the model value does not match any option value?
Those. so that when the page loads, if there is no value, then it would immediately overwrite the model.
<select v-model="RefRealValueArr[paramName][index]">
<option :value="null">Нет</option>
<option :value="key" v-for="(value, key) in refValuesChosen">
{{value}}
</option>
</select>
Answer the question
In order to leave comments, you need to log in
Of course, I don't know what kind of data array you have there.
But through created, I would implement it like this.
those. in select v-model we make the property definable via a function.
And in it we already carry out the checks we need and derive what we need.
I think by disassembling my code in jsfiddle, you will cope with your task
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question