I have the following code for my select
<q-select label="Select country" behavior="menu" :lazy-rules="true" :rules="[val => !!val || 'Select your country']" dense outlined v-model="form.code" :options="countries" option-label="name" option-value="code"> </q-select>And my vuejs code i have
<script> export default{ data:()=>({ form:{ code:"" } countries:[ {name:"Country-1", code:"+101"}, {name:"Country-2", code:"+201"}, ] }) } <script>From the above i expect the value of form.code to be the code eg: +101 but when i check i find the value is the full object. What am i missing since on my select i have already set the option-label and option-value
What am i missing?
2 Answers
You need to use emit-value and map-options, see:
Currently way to that with your custom object name is too override, see